Added notarize_no_exc method to return success state instead of raising the exception
This commit is contained in:
parent
49c4c97645
commit
7093f13a10
@ -79,6 +79,21 @@ class CasWrapper:
|
||||
result_of_execution = command()
|
||||
return json.loads(result_of_execution)['hash']
|
||||
|
||||
def notarize_no_exc(
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user