Skip to content

Commit 50fbc5c

Browse files
Address comments
1 parent 60fe4eb commit 50fbc5c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/cli/credential.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,12 @@ def _run_set_command(service_client: client.ServiceClient, args: argparse.Namesp
9898
print(f'File {value} cannot be found.')
9999
sys.exit(1)
100100

101-
if args.type == 'DATA' and 'endpoint' not in cred_payload:
102-
raise osmo_errors.OSMOUserError('Endpoint is required for DATA credentials.')
101+
if args.type == 'DATA':
102+
# Validate that the data credential is valid
103+
try:
104+
credentials.StaticDataCredential(**cred_payload)
105+
except Exception as err: # pylint: disable=broad-except
106+
raise osmo_errors.OSMOUserError(f'Invalid DATA credential: {str(err)}')
103107

104108
elif args.type == 'GENERIC':
105109
cred_payload = {'credential': cred_payload}

src/utils/job/workflow.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,7 @@ def _fetch_bucket_info(dataset_info: common.DatasetStructure)\
661661
seen_uri_output.add(bucket_info.uri)
662662

663663
except osmo_errors.OSMOCredentialError as err:
664-
# If user's existing credentials do not have access,
665-
# check if the backend supports environment authentication
666-
has_access = bucket_info.supports_environment_auth
664+
has_access = False
667665
else:
668666
# If user does not have any credentials,
669667
# check if the backend supports environment authentication

0 commit comments

Comments
 (0)