summaryrefslogtreecommitdiff
path: root/cxmanage_api/node.py
diff options
context:
space:
mode:
Diffstat (limited to 'cxmanage_api/node.py')
-rw-r--r--cxmanage_api/node.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/cxmanage_api/node.py b/cxmanage_api/node.py
index 36c423a..2eb9d11 100644
--- a/cxmanage_api/node.py
+++ b/cxmanage_api/node.py
@@ -913,7 +913,7 @@ communication.
except IpmiError as error:
if str(error) != "Error resetting firmware to factory default":
raise
- time.sleep(5) # pausing between retries seems to help a little
+ time.sleep(5) # pausing between retries seems to help a little
else:
self.bmc.reset_firmware()
@@ -1586,6 +1586,27 @@ obtained.
return results
+ def get_uplink_status(self):
+ """Get the uplink status for this node
+
+ >>> node.get_uplink_status()
+ {0: True, 1: False, 2: True, 3: True}
+
+ :return: A dictionary mapping uplink to status
+ :rtype: dict
+
+ """
+ results = {}
+ uplink_status = self.bmc.fabric_get_uplink_status()
+ regex = re.compile(r'U(\d+)\(N\d+\) (\w+):')
+ for uplink, status in regex.findall(uplink_status):
+ if(status == 'Good'):
+ results[uplink] = True
+ else:
+ results[uplink] = False
+
+ return results
+
def read_fru(self, fru_number, offset=0, bytes_to_read=-1):
"""Read from node's fru starting at offset.
This is equivalent to the ipmitool fru read command.