Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the netApp model obtaining error #870

Merged
merged 11 commits into from
May 20, 2022
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