Skip to content

Commit

Permalink
Removed comments and extra troubleshooting logging from newly added f…
Browse files Browse the repository at this point in the history
…unctions.
  • Loading branch information
grdavies-ntnx committed Apr 14, 2021
1 parent 61b1cc5 commit 58e07ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 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.2.3", "4/14/2021", "Removed comments and extra troubleshooting logging from newly added functions."
"1.2.2", "4/14/2021", "Added StoragePool.get, StoragePool.search_uuid, StoragePool.search_name, StoragePool.get, StorageContainer.create, StorageContainer.update, StorageContainer.delete_name and StorageContainer.delete_uuid."
"1.1.30", "4/1/2021", "Added prism.Vms.get_protection_rules."
"1.1.29", "3/31/2021", "Added prism.Config.get_protection_rules."
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', '2', '2')
__version_info__ = ('1', '2', '3')
__version__ = '.'.join(__version_info__)
7 changes: 1 addition & 6 deletions ntnx_api/prism.py
Original file line number Diff line number Diff line change
Expand Up @@ -3320,6 +3320,7 @@ def search_uuid(self, uuid, clusteruuid=None, refresh=False):
if not self.storage_containers.get(clusteruuid) or refresh:
logger.info('refreshing storage containers')
self.get(clusteruuid)

logger.info('searching containers in cluster "{0}" for uuid "{1}".'.format(clusteruuid, uuid))
logger.info('cluster {0} storage containers: {1}'.format(clusteruuid, self.storage_containers.get(clusteruuid)))
found = next((item for item in self.storage_containers.get(clusteruuid) if item.get("storage_container_uuid") == uuid), None)
Expand All @@ -3339,19 +3340,13 @@ def search_name(self, name, clusteruuid=None, refresh=False):
:rtype: ResponseDict
"""
logger = logging.getLogger('ntnx_api.prism.StorageContainer.search_name')
# found = None
if not self.storage_containers.get(clusteruuid) or refresh:
logger.info('refreshing storage containers')
self.get(clusteruuid)

# containers = self.storage_containers.get(clusteruuid)
logger.info('searching containers in cluster "{0}" for name "{1}".'.format(clusteruuid, name))
logger.info('cluster {0} storage containers: {1}'.format(clusteruuid, self.storage_containers.get(clusteruuid)))
found = next((item for item in self.storage_containers.get(clusteruuid) if item.get("name") == name), None)
# for entity in containers:
# if entity.get('name') == name:
# found = entity
# break
logger.info('found storage container: {0}'.format(found))
return found

Expand Down

0 comments on commit 58e07ba

Please sign in to comment.