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

update scaleio initiators descroption #547

Merged
merged 3 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions delfin/drivers/dell_emc/scaleio/rest_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,13 @@ def list_alerts(self, query_para=None):
if not alert_util.is_alert_in_time_range(query_para,
alert_time):
continue
alert_type = json_alert.get('alertType')
alert_model = {
'alert_id': json_alert.get('id'),
'alert_name': json_alert.get('name'),
'alert_name': alert_type + json_alert.get('name'),
'severity': json_alert.get('severity'),
'category': constants.Category.FAULT,
'type': json_alert.get('alertType'),
'type': alert_type,
'sequence_number': json_alert.get('uuid'),
'description': json_alert.get('alertType'),
'occur_time': alert_time,
Expand All @@ -277,7 +278,10 @@ def list_storage_host_initiators(self, storage_id):
consts.REST_SCALIO_INITIIATORS)
for initiators_json in (storage_initiators or []):
status = initiators_json.get('mdmConnectionState')
initiators_id = initiators_json['id']
initiators_id = initiators_json.get('id')
description = constants.InitiatorType.UNKNOWN
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

描述内容怎么是放的类型?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change field to "type"

if 'iscsi' in initiators_json.get('perfProfile'):
description = constants.InitiatorType.ISCSI
if 'Connected' == status:
status = constants.HostStatus.NORMAL
elif 'Disconnected' == status:
Expand All @@ -287,6 +291,7 @@ def list_storage_host_initiators(self, storage_id):
"storage_id": storage_id,
"native_storage_host_initiator_id": initiators_id,
"wwn": initiators_id,
'description': description,
"status": status,
"native_storage_host_id": initiators_json.get(
'protectionDomainId'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@
SYSTEM_ALERT = [
{
'alert_id': '31d682d5-e696-466e-990a-57d0f9616b21',
'alert_name': '31d682d5-e696-466e-990a-57d0f9616b21',
'alert_name': 'TRIAL_LICENSE_USED31d682d5-e696-466e-990a-57d0f9616b21',
'severity': 'ALERT_LOW',
'category': 'Fault',
'type': 'TRIAL_LICENSE_USED',
Expand Down