Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make config lookups case insensitive #22

Merged
merged 1 commit into from
Sep 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions rcm_nexus/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_password(self):
return self.password

def get_profile_id(self, product, is_ga):
profiles = self.profile_map.get(product)
profiles = self.profile_map.get(product.upper())
if profiles is None:
raise Exception( "No staging profiles found for: '%s' in environment: %s" % (product, self.name) )

Expand All @@ -65,7 +65,9 @@ def get_profile_id(self, product, is_ga):
return profile_id

def get_promote_profile_id(self, product, is_ga):
return self.profile_map[product][GA_PROMOTE_PROFILE if is_ga else EA_PROMOTE_PROFILE]
return self.profile_map[product.upper()][
GA_PROMOTE_PROFILE if is_ga else EA_PROMOTE_PROFILE
]

def __str__(self):
return """RCMNexusConfig [
Expand Down Expand Up @@ -126,7 +128,7 @@ def _read_config(path):
with open(path) as f:
parser.readfp(f)
for product in parser.sections():
result[product] = dict(parser.items(product))
result[product.upper()] = dict(parser.items(product))
return result


Expand Down