Skip to content

Commit

Permalink
Merge pull request #38 from naved001/fix-attribute-name
Browse files Browse the repository at this point in the history
Use correct attribute name for institution specific code
  • Loading branch information
naved001 authored Feb 9, 2024
2 parents b3127bc + 8c79c7f commit a5b0503
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions openshift_metrics/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_get_namespace_attributes(self, mock_session, mock_post):
{
"attributes": {
"Allocated Project Name": "Project 1",
"Institution - Specific Code": "123"
"Institution-Specific Code": "123"
},
"project": {
"pi": "PI 1",
Expand All @@ -60,7 +60,7 @@ def test_get_namespace_attributes(self, mock_session, mock_post):
{
"attributes": {
"Allocated Project Name": "Project 2",
"Institution - Specific Code": "456"
"Institution-Specific Code": "456"
},
"project": {
"pi": "PI 2",
Expand Down
2 changes: 1 addition & 1 deletion openshift_metrics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def get_namespace_attributes():
project_name = response["attributes"].get("Allocated Project Name")
cf_pi = response["project"].get("pi", project_name)
cf_project_id = response["project"].get("id", 0)
institution_code = response["attributes"].get("Institution - Specific Code", "")
institution_code = response["attributes"].get("Institution-Specific Code", "")
namespaces_dict[project_name] = { "cf_pi": cf_pi, "cf_project_id": cf_project_id, "institution_code": institution_code }

return namespaces_dict
Expand Down

0 comments on commit a5b0503

Please sign in to comment.