Skip to content

Commit

Permalink
Fix the netApp model obtaining error (#870)
Browse files Browse the repository at this point in the history
  • Loading branch information
guankc authored May 20, 2022
1 parent 00a5d58 commit c9c842c
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions delfin/drivers/netapp/dataontap/netapp_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@ def get_storage(self):
system_info, storage_map_list, split=':')
if len(storage_map_list) > 0:
storage_map = storage_map_list[-1]
controller_map = controller_map_list[1]
controller = None
for controller_map in controller_map_list[1:]:
if controller_map['Model'] != '-':
controller = controller_map
continue
controller = controller_map_list[1]
for disk in disk_list:
raw_capacity += disk['capacity']
for pool in pool_list:
Expand All @@ -184,11 +189,13 @@ def get_storage(self):
storage_model = {
"name": storage_map['ClusterName'],
"vendor": constant.STORAGE_VENDOR,
"model": controller_map['Model'],
"model": controller['Model'],
"status": status,
"serial_number": storage_map['ClusterSerialNumber'],
"serial_number":
storage_map['ClusterUUID'] +
':' + storage_map['ClusterSerialNumber'],
"firmware_version": storage_version[0],
"location": controller_map['Location'],
"location": controller['Location'],
"total_capacity": total_capacity,
"raw_capacity": raw_capacity,
"used_capacity": used_capacity,
Expand Down Expand Up @@ -1015,7 +1022,8 @@ def do_rest_call(self, url, data):
elif res.status_code == constant.FORBIDDEN_RETURN_CODE:
raise exception.InvalidUsernameOrPassword()
elif res.status_code == constant.NOT_FOUND_RETURN_CODE:
raise exception.NotFound()
LOG.error('Url did not get results url:%s' % url)
return []
elif res.status_code == constant.METHOD_NOT_ALLOWED_CODE:
raise exception.Invalid()
elif res.status_code == constant.CONFLICT_RETURN_CODE:
Expand Down Expand Up @@ -1094,7 +1102,8 @@ def get_storage_perf(self, metrics, storage_id, start_time, end_time):
get_perf_value(metrics, storage_id,
start_time, end_time,
json_info,
storage['ClusterSerialNumber'],
storage['ClusterUUID'] + ':'
+ storage['ClusterSerialNumber'],
storage['ClusterName'],
constants.ResourceType.STORAGE)
return storage_metrics
Expand Down

0 comments on commit c9c842c

Please sign in to comment.