ALBS-444 #2

Merged
anfimovdm merged 9 commits from ALBS-444 into master 2022-07-01 14:25:17 +00:00
3 changed files with 12 additions and 3 deletions
Showing only changes of commit 3395ddc9e3 - Show all commits

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 "