Skip to content

Commit

Permalink
Merge pull request #217 from galaxyproject/209-profile
Browse files Browse the repository at this point in the history
Handle no profile
  • Loading branch information
ksuderman authored Jun 13, 2023
2 parents 1dda8ea + 31ad27b commit 3f3082d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions abm/lib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def load_profiles():
:return: a dictionary containing the YAML content of the configuration.
'''
yaml = get_yaml_parser()
profiles = None
profiles = {}
for profile_path in PROFILE_SEARCH_PATH:
profile_path = os.path.expanduser(profile_path)
if os.path.exists(profile_path):
Expand Down Expand Up @@ -131,8 +131,9 @@ def parse_profile(profile_name: str):
if profile_name not in profiles:
print(f'ERROR: {profile_name} is not the name of a valid profile.')
keys = list(profiles.keys())
quoted_keys = ', '.join([f"'{k}'" for k in keys[0:-2]]) + f", and '{keys[-1]}'"
print(f'The defined profile names are: {quoted_keys}')
if len(keys) > 0:
quoted_keys = ', '.join([f"'{k}'" for k in keys[0:-2]]) + f", and '{keys[-1]}'"
print(f'The defined profile names are: {quoted_keys}')
return None, None, None
profile = profiles[profile_name]
if 'kube' in profile:
Expand Down

0 comments on commit 3f3082d

Please sign in to comment.