ALBS-444 #2
@ -122,8 +122,7 @@ class CasWrapper:
|
||||
self.ensure_login()
|
||||
try:
|
||||
result_json = self.authenticate(local_path, return_json=True)
|
||||
anfimovdm marked this conversation as resolved
|
||||
# it should return 0 for authenticated and trusted commits
|
||||
is_authenticated = not bool(result_json['status'])
|
||||
is_authenticated = result_json['verified']
|
||||
commit_cas_hash = result_json['hash']
|
||||
# we can fall with ProcessExecutionError,
|
||||
# because source can be not notarized
|
||||
@ -135,7 +134,6 @@ class CasWrapper:
|
||||
self,
|
||||
local_path: str,
|
||||
use_hash: bool = False,
|
||||
return_json: bool = False,
|
||||
) -> bool:
|
||||
"""
|
||||
Authenticates artifact by artifact path or hash if `use_hash` is True.
|
||||
@ -147,10 +145,10 @@ class CasWrapper:
|
||||
is_authenticated = self.authenticate(
|
||||
local_path,
|
||||
use_hash=use_hash,
|
||||
anfimovdm marked this conversation as resolved
Outdated
AvoidMe
commented
Instead of Instead of `with self` I would prefer `self.ensure_login()` or something, because you didn't use __exit__
anfimovdm
commented
Done Done
|
||||
return_json=return_json,
|
||||
)
|
||||
return_json=True,
|
||||
anfimovdm marked this conversation as resolved
Outdated
soksanichenko
commented
I guess colon is not needed in the logging message or it's in wrong place of the message I guess colon is not needed in the logging message or it's in wrong place of the message
|
||||
)['verified']
|
||||
# we can fall with ProcessExecutionError,
|
||||
# because source can be not notarized
|
||||
# because artifact can be not notarized
|
||||
except ProcessExecutionError:
|
||||
self._logger.exception('Cannot authenticate: %s', local_path)
|
||||
return is_authenticated
|
||||
|
Loading…
Reference in New Issue
Block a user
You don't get hash because use_hash equals to Fasle by default
I can get hash here, because when I use
return_json
flag,self.authenticate
returns full JSON response