Skip to content

Commit

Permalink
Increase judgment
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanyu-ghca committed Oct 28, 2022
1 parent 7d99180 commit a28c0e2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions delfin/drivers/dell_emc/vnx/vnx_block/component_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_storage(self):
status = constants.StorageStatus.NORMAL
raw_cap = self.handle_disk_capacity()
pool_capacity = self.handle_pool_capacity()
if domain and agent:
if domain and agent and pool_capacity:
result = {
'name': domain[0].get('node'),
'vendor': consts.EMCVNX_VENDOR,
Expand All @@ -54,8 +54,10 @@ def get_storage(self):
'free_capacity': pool_capacity.get('free_capacity')
}
else:
err_msg = "domain or agent error: %s, %s" %\
(six.text_type(domain), six.text_type(agent))
err_msg = "Get vnx storage info failed, domain: %s, agent: %s," \
" pool_capacity: %s" % (six.text_type(domain),
six.text_type(agent),
six.text_type(pool_capacity))
LOG.error(err_msg)
raise exception.StorageBackendException(err_msg)
return result
Expand Down

0 comments on commit a28c0e2

Please sign in to comment.