Skip to content

Commit

Permalink
solve the issue which when ethport not connect,the speed is none (#766)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanjiangyu-ghca authored Nov 3, 2021
1 parent 2870293 commit c05b49f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions delfin/drivers/dell_emc/unity/unity.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,10 @@ def get_eth_ports(self):
'health_status': status,
'type': constants.PortType.ETH,
'logical_type': '',
'speed': int(content.get('speed')) * units.M,
'max_speed': int(content.get('speed')) * units.M,
'speed': int(content.get('speed')) * units.M
if content.get('speed') is not None else None,
'max_speed': int(content.get('speed')) * units.M
if content.get('speed') is not None else None,
'native_parent_id':
content.get('storageProcessor', {}).get('id'),
'wwn': '',
Expand Down Expand Up @@ -338,10 +340,10 @@ def get_fc_ports(self):
'health_status': status,
'type': constants.PortType.FC,
'logical_type': '',
'speed': int(
content.get('currentSpeed', 0)) * units.G,
'max_speed': int(
content.get('currentSpeed', 0)) * units.G,
'speed': int(content.get('currentSpeed')) * units.G
if content.get('currentSpeed') is not None else None,
'max_speed': int(content.get('currentSpeed')) * units.G
if content.get('currentSpeed') is not None else None,
'native_parent_id':
content.get('storageProcessor', {}).get('id'),
'wwn': content.get('wwn')
Expand Down

0 comments on commit c05b49f

Please sign in to comment.