diff options
author | evasquez <eric.vasquez@calxeda.com> | 2013-08-15 09:25:47 -0500 |
---|---|---|
committer | evasquez <eric.vasquez@calxeda.com> | 2013-08-15 09:25:47 -0500 |
commit | a2cada8b840538bead465bfed52a661ccb86f041 (patch) | |
tree | 48d9935ad426c347e446de2959a37ed8651af489 | |
parent | f99dd28e632826f540ea9abdb8591d98d47a4d43 (diff) | |
download | cxmanage-a2cada8b840538bead465bfed52a661ccb86f041.tar.gz |
Fixed some code comments that were effecting sphinx doc output.
-rw-r--r-- | cxmanage_api/fabric.py | 1 | ||||
-rw-r--r-- | cxmanage_api/node.py | 24 |
2 files changed, 15 insertions, 10 deletions
diff --git a/cxmanage_api/fabric.py b/cxmanage_api/fabric.py index 807df90..9d47814 100644 --- a/cxmanage_api/fabric.py +++ b/cxmanage_api/fabric.py @@ -877,6 +877,7 @@ class Fabric(object): :return: mac address mask :rtype: string + """ return self.primary_node.bmc.fabric_config_get_macaddr_mask() diff --git a/cxmanage_api/node.py b/cxmanage_api/node.py index 01e3d68..b70fe40 100644 --- a/cxmanage_api/node.py +++ b/cxmanage_api/node.py @@ -954,7 +954,7 @@ class Node(object): components.append(("uboot_version", "A9_UBOOT")) components.append(("ubootenv_version", "UBOOTENV")) components.append(("dtb_version", "DTB")) - + # Get the node FRU version try: node_fru_version = self.get_node_fru_version() @@ -1451,6 +1451,7 @@ class Node(object): def get_uplink_speed(self): """Get the uplink speed of this node. + >>> node.get_uplink_speed() 1 @@ -1462,6 +1463,7 @@ class Node(object): def get_uplink_info(self): """Get the uplink information for this node. + >>> node.get_uplink_info() 'Node 0: eth0 0, eth1 0, mgmt 0' @@ -1473,6 +1475,7 @@ class Node(object): def get_node_fru_version(self): """Get the node FRU version. + >>> node.get_node_fru_version 'bf7b471716113d5b9c47c6a5dd25f7a83f5c235c' @@ -1483,7 +1486,7 @@ class Node(object): and reading only the version from that file. The in-file offset for the node FRU version is 516, and the length of the version string is 40 bytes. - + """ version = self._read_fru(81, offset=516, bytes_to_read=40) # If there is an error reading the FRU, every byte could be x00 @@ -1492,11 +1495,12 @@ class Node(object): # If the version string is less than 40 bytes long, remove the x00's version = version.replace("\x00", "") - + return version def get_slot_fru_version(self): """Get the slot FRU version. + >>> node.get_slot_fru_version 'Unknown' @@ -1507,10 +1511,10 @@ class Node(object): and reading only the version from that file. The in-file offset for the node FRU version is 516, and the length of the version string is 40 bytes. - - Note that some system boards do not have slot FRUs, and are + + Note that some system boards do not have slot FRUs, and are therefore expected to raise an exception. - + """ version = self._read_fru(82, offset=516, bytes_to_read=40) # If there is an error reading the FRU, every byte could be x00 @@ -1519,7 +1523,7 @@ class Node(object): # If the version string is less than 40 bytes long, remove the x00's version = version.replace("\x00", "") - + return version def _run_fabric_command(self, function_name, **kwargs): @@ -1753,10 +1757,10 @@ class Node(object): "Unable to increment SIMG priority, too high") return priority - def _read_fru(node, fru_number, offset=0, bytes_to_read=-1): - """Read from node's fru starting at offset. + def _read_fru(node, 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. - + """ # Use a temporary file to store the FRU image with tempfile.NamedTemporaryFile(delete=True) as hexfile: |