Added notarize_no_exc method to return success state instead of raising the exception #5

Merged
Korulag merged 2 commits from albs-637 into master 2022-09-14 20:02:22 +00:00
2 changed files with 16 additions and 1 deletions
Showing only changes of commit 7093f13a10 - Show all commits

View File

@ -79,6 +79,21 @@ class CasWrapper:
result_of_execution = command()
return json.loads(result_of_execution)['hash']
def notarize_no_exc(
soksanichenko marked this conversation as resolved
Review

Please, add docstring, or expand name of the method. It's unclear

Please, add docstring, or expand name of the method. It's unclear
self,
local_path: str,
metadata: typing.Dict = None,
) -> typing.Tuple[bool, str]:
success = False
try:
cas_hash = self.notarize(local_path, metadata=metadata)
success = True
except Exception:
self._logger.exception('Cannot notarize artifact: %s',
local_path)
cas_hash = ''
return success, cas_hash
def authenticate(
self,
local_path: str,

View File

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