ALBS-444: Fixes for integraion in build node

This commit is contained in:
Daniil Anfimov 2022-06-24 10:40:24 +02:00
parent bd5686e9e4
commit 3395ddc9e3
3 changed files with 12 additions and 3 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

View File

@ -64,6 +64,7 @@ class CasWrapper:
def authenticate(
self,
local_path: str,
return_json: bool = False,
):
"""
Wrapper around `cas authenticate`
@ -71,7 +72,8 @@ class CasWrapper:
(should be started from `git://`)
or to a single local file
:return: true if a commit is trusted, vice versa - false
:rtype: bool
or dict with result if return_json param is True
:rtype: bool or dict
"""
command = self._cas[
'authenticate',
@ -92,4 +94,7 @@ class CasWrapper:
):
# in case if commit is untrusted
result_of_execution = command(retcode=1)
return not bool(json.loads(result_of_execution)['status'])
json_result = json.loads(result_of_execution)
if return_json:
return json_result
return not bool(json_result['status'])

View File

@ -2,7 +2,7 @@ from setuptools import setup
setup(
name="cas_wrapper",
version="0.0.1",
version="0.0.2",
author="Stepan Oksanichenko",
author_email="soksanichenko@almalinux.org",
description="The python wrapper around binary cas from "