Skip to content

Commit

Permalink
Merge branch 'gh-ca:vsp_0125' into vsp_0125
Browse files Browse the repository at this point in the history
  • Loading branch information
tanjiangyu-ghca authored Feb 10, 2022
2 parents 183d0be + a699fa2 commit 97762e5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions delfin/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,9 @@ class HostStatus(object):
NORMAL = 'normal'
OFFLINE = 'offline'
ABNORMAL = 'abnormal'
DEGRADED = 'degraded'

ALL = (NORMAL, OFFLINE, ABNORMAL)
ALL = (NORMAL, OFFLINE, ABNORMAL, DEGRADED)


class HostOSTypes(object):
Expand Down Expand Up @@ -279,9 +280,11 @@ class InitiatorType(object):
FC = 'fc'
ISCSI = 'iscsi'
NVME_OVER_ROCE = 'roce'
SAS = 'sas'
NVME_OVER_FABRIC = 'nvme-of'
UNKNOWN = 'unknown'

ALL = (FC, ISCSI, NVME_OVER_ROCE, UNKNOWN)
ALL = (FC, ISCSI, NVME_OVER_ROCE, SAS, NVME_OVER_FABRIC, UNKNOWN)


# Enumerations for alert severity
Expand Down
2 changes: 1 addition & 1 deletion delfin/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def __init__(self, user_id=None, project_id=None, is_admin=None,
super(RequestContext, self).__init__(
auth_token=auth_token,
user=user_id or user,
tenant=project_id or tenant,
domain=kwargs.pop('domain', None),
user_domain=kwargs.pop('user_domain', None),
project_domain=kwargs.pop('project_domain', None),
Expand All @@ -70,6 +69,7 @@ def __init__(self, user_id=None, project_id=None, is_admin=None,
roles=roles)

self.user_id = self.user
self.tenant = project_id or tenant
self.project_id = self.tenant

self.read_deleted = read_deleted
Expand Down
6 changes: 3 additions & 3 deletions delfin/drivers/ibm/storwize_svc/ssh_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def get_fc_port(self, storage_id):
port_result = {
'name': location,
'storage_id': storage_id,
'native_port_id': location,
'native_port_id': port_map.get('id'),
'location': location,
'connection_status': conn_status,
'health_status': status,
Expand Down Expand Up @@ -748,7 +748,7 @@ def packege_data(self, storage_id, resource_type, metrics, metric_map):
resource_info).get('iops').get(iops_time)
res_value = \
res_value / iops_value if iops_value else 0
res_value = round(res_value, 2)
res_value = round(res_value, 3)
metric_map[resource_info][target][res_time] = \
res_value
break
Expand Down Expand Up @@ -785,7 +785,7 @@ def count_metric_data(last_data, now_data, interval, target, metric_type,
elif 'IOPS' in metric_type.upper() or 'RESPONSETIME' \
in metric_type.upper():
value = value / interval
value = round(value, 2)
value = round(value, 3)
if metric_map.get(res_id):
if metric_map.get(res_id).get(metric_type):
if metric_map.get(res_id).get(metric_type).get(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ def __init__(self):
{
'name': 'node1_0',
'storage_id': '12345',
'native_port_id': 'node1_0',
'native_port_id': '0',
'location': 'node1_0',
'connection_status': 'connected',
'health_status': 'normal',
Expand Down

0 comments on commit 97762e5

Please sign in to comment.