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(
|
||||
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'])
|
||||
|
Loading…
Reference in New Issue
Block a user