Skip to content

Commit

Permalink
Fixed variable typo in prism.Hosts.get_project and prism.Hosts.get_ca…
Browse files Browse the repository at this point in the history
…tegories
  • Loading branch information
grdavies-ntnx committed Mar 31, 2021
1 parent 18ba26f commit 2af1f11
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ A log of changes by version and date.
:header: "Version", "Date", "Notes"
:widths: 10, 10, 60

"1.1.22", "3/30/2021", "Fixed variable typo in prism.Hosts.get_project and prism.Hosts.get_categories."
"1.1.21", "3/30/2021", "Fixed flake8 warnings for logging changes."
"1.1.21", "3/30/2021", "Updated logging to use an environment variable NTNX_API_LOG_LEVEL to dictate stdout logging. Default log level is WARNING"
"1.1.20", "3/30/2021", "Resolved issues with metadata functions. Renamed variables in vms tests."
Expand Down
2 changes: 1 addition & 1 deletion ntnx_api/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module

__version_info__ = ('1', '1', '21')
__version_info__ = ('1', '1', '22')
__version__ = '.'.join(__version_info__)
8 changes: 4 additions & 4 deletions ntnx_api/prism.py
Original file line number Diff line number Diff line change
Expand Up @@ -2481,7 +2481,7 @@ def get_metadata(self, refresh=False):
# Remove existing data for this cluster if it exists
if not self.metadata or refresh:
self.metadata = {}
logger.info('removing existing data from class dict hosts_metadata')
logger.info('removing existing data from class dict metadata')

hosts = self.api_client.request(uri=uri, api_version='v3', payload=payload, params=params).get('entities')
for host in hosts:
Expand Down Expand Up @@ -2580,7 +2580,7 @@ def get_project(self, uuid, refresh=False):
project = ''
if self.api_client.connection_type == "pc":
self.get_metadata(refresh=refresh)
metadata = self.hosts_metadata.get(uuid)
metadata = self.metadata.get(uuid)
if metadata:
if metadata.get('project_reference').get('kind') == 'project':
project = metadata.get('project_reference').get('name')
Expand All @@ -2601,7 +2601,7 @@ def get_categories(self, uuid, refresh=False):
categories = {}
if self.api_client.connection_type == "pc":
self.get_metadata(refresh=refresh)
metadata = self.hosts_metadata.get(uuid)
metadata = self.metadata.get(uuid)
if metadata:
if 'categories' in metadata:
for key, value in metadata.get('categories').items():
Expand Down Expand Up @@ -2681,7 +2681,7 @@ def get_metadata(self, refresh=False):
# Remove existing data for this cluster if it exists
if not self.metadata or refresh:
self.metadata = {}
logger.info('removing existing data from class dict vms_metadata')
logger.info('removing existing data from class dict metadata')

vms = self.api_client.request(uri=uri, api_version='v3', payload=payload, params=params).get('entities')
logger.info('returned data: {0}'.format(vms))
Expand Down

0 comments on commit 2af1f11

Please sign in to comment.