ALBS-444: Fixes for integraion in build node
This commit is contained in:
parent
bd5686e9e4
commit
3395ddc9e3
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
@ -64,6 +64,7 @@ class CasWrapper:
|
|||||||
def authenticate(
|
def authenticate(
|
||||||
self,
|
self,
|
||||||
local_path: str,
|
local_path: str,
|
||||||
|
return_json: bool = False,
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Wrapper around `cas authenticate`
|
Wrapper around `cas authenticate`
|
||||||
@ -71,7 +72,8 @@ class CasWrapper:
|
|||||||
(should be started from `git://`)
|
(should be started from `git://`)
|
||||||
or to a single local file
|
or to a single local file
|
||||||
:return: true if a commit is trusted, vice versa - false
|
: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[
|
command = self._cas[
|
||||||
'authenticate',
|
'authenticate',
|
||||||
@ -92,4 +94,7 @@ class CasWrapper:
|
|||||||
):
|
):
|
||||||
# in case if commit is untrusted
|
# in case if commit is untrusted
|
||||||
result_of_execution = command(retcode=1)
|
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'])
|
||||||
|
2
setup.py
2
setup.py
@ -2,7 +2,7 @@ from setuptools import setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="cas_wrapper",
|
name="cas_wrapper",
|
||||||
version="0.0.1",
|
version="0.0.2",
|
||||||
author="Stepan Oksanichenko",
|
author="Stepan Oksanichenko",
|
||||||
author_email="soksanichenko@almalinux.org",
|
author_email="soksanichenko@almalinux.org",
|
||||||
description="The python wrapper around binary cas from "
|
description="The python wrapper around binary cas from "
|
||||||
|
Loading…
Reference in New Issue
Block a user