diff options
author | George Kraft <george.kraft@calxeda.com> | 2012-08-16 12:18:10 -0500 |
---|---|---|
committer | George Kraft <george.kraft@calxeda.com> | 2012-08-16 12:18:10 -0500 |
commit | 02f53e4f9095a2b5facfd4fe8ce0265a78df451c (patch) | |
tree | 6ac5a96afdad72da0521c9921027b31d7c14454d | |
parent | 2f45a6b331290232536578085c95b0d1c51b1af3 (diff) | |
download | pyipmi-02f53e4f9095a2b5facfd4fe8ce0265a78df451c.tar.gz |
fw: Change "slot" response fields to "partition"
Although it will still read the old response fields if they're
there. This way we don't break compatibility with older versions
of ipmitool.
-rw-r--r-- | pyipmi/bmc.py | 28 | ||||
-rw-r--r-- | pyipmi/commands/fw.py | 28 |
2 files changed, 30 insertions, 26 deletions
diff --git a/pyipmi/bmc.py b/pyipmi/bmc.py index 30d53d6..7955835 100644 --- a/pyipmi/bmc.py +++ b/pyipmi/bmc.py @@ -143,34 +143,34 @@ class BMC(object): def get_chassis_status(self): return self.handle.chassis_status() - def update_socman(self, filename, slot, tftp_addr): - return self.update_firmware(filename, slot, '3', tftp_addr) + def update_socman(self, filename, partition, tftp_addr): + return self.update_firmware(filename, partition, '3', tftp_addr) - def update_firmware(self, filename, slot, image_type, tftp_addr): - return self.handle.fw_download(filename=filename, slot=slot, + def update_firmware(self, filename, partition, image_type, tftp_addr): + return self.handle.fw_download(filename=filename, partition=partition, image_type=image_type, tftp_addr=tftp_addr) - def retrieve_firmware(self, filename, slot, image_type, tftp_addr): - return self.handle.fw_upload(filename=filename, slot=slot, + def retrieve_firmware(self, filename, partition, image_type, tftp_addr): + return self.handle.fw_upload(filename=filename, partition=partition, image_type=image_type, tftp_addr=tftp_addr) - def activate_firmware(self, slot): - return self.handle.fw_activate(slot=slot) + def activate_firmware(self, partition): + return self.handle.fw_activate(partition=partition) - def invalidate_firmware(self, slot): - return self.handle.fw_invalidate(slot=slot) + def invalidate_firmware(self, partition): + return self.handle.fw_invalidate(partition=partition) - def set_firmware_flags(self, slot, flags): - return self.handle.fw_flags(slot=slot, flags=flags) + def set_firmware_flags(self, partition, flags): + return self.handle.fw_flags(partition=partition, flags=flags) def get_firmware_status(self, tftp_handle): return self.handle.fw_status(tftp_handle=tftp_handle) - def check_firmware(self, slot): - return self.handle.fw_check(slot=slot) + def check_firmware(self, partition): + return self.handle.fw_check(partition=partition) def cancel_firmware(self, job_id): return self.handle.fw_cancel(job_id=job_id) diff --git a/pyipmi/commands/fw.py b/pyipmi/commands/fw.py index 937e7fc..6fbc101 100644 --- a/pyipmi/commands/fw.py +++ b/pyipmi/commands/fw.py @@ -61,7 +61,8 @@ class FWDownloadCommand(CommandWithErrors): response_fields = { 'File Name' : {}, - 'Slot' : {}, + 'Partition' : {}, + 'Slot' : {'attr': 'partition'}, 'Type' : {}, 'IP' : {}, 'TFTP Handle ID' : {}, @@ -73,7 +74,7 @@ class FWDownloadCommand(CommandWithErrors): """ """ return ["cxoem", "fw", "download", self._params['filename'], - self._params['slot'], self._params['image_type'], + self._params['partition'], self._params['image_type'], "tftp", self._params['tftp_addr']] @@ -87,7 +88,8 @@ class FWUploadCommand(CommandWithErrors): response_fields = { 'File Name' : {}, - 'Slot' : {}, + 'Partition' : {}, + 'Slot' : {'attr': 'partition'}, 'Type' : {}, 'IP' : {}, 'TFTP Handle ID' : {}, @@ -98,7 +100,7 @@ class FWUploadCommand(CommandWithErrors): def ipmitool_args(self): """ """ - return ["cxoem", "fw", "upload", self._params['slot'], + return ["cxoem", "fw", "upload", self._params['partition'], self._params['filename'], self._params['image_type'], "tftp", self._params['tftp_addr']] @@ -119,7 +121,7 @@ class FWActivateCommand(CommandWithErrors): def ipmitool_args(self): """ """ - return ["cxoem", "fw", "activate", self._params['slot']] + return ["cxoem", "fw", "activate", self._params['partition']] class FWInvalidateCommand(CommandWithErrors): @@ -138,7 +140,7 @@ class FWInvalidateCommand(CommandWithErrors): def ipmitool_args(self): """ """ - return ["cxoem", "fw", "invalidate", self._params['slot']] + return ["cxoem", "fw", "invalidate", self._params['partition']] class FWFlagsCommand(CommandWithErrors): @@ -157,7 +159,7 @@ class FWFlagsCommand(CommandWithErrors): def ipmitool_args(self): """ """ - return ["cxoem", "fw", "flags", self._params['slot'], + return ["cxoem", "fw", "flags", self._params['partition'], self._params['flags']] @@ -171,7 +173,7 @@ class FWStatusCommand(CommandWithErrors): response_fields = { 'Status' : {}, - 'Error' : {'attr': 'error'} + 'Error' : {} } @property @@ -190,16 +192,17 @@ class FWCheckCommand(CommandWithErrors): result_type = FWCheckResult response_fields = { - 'Slot' : {}, + 'Partition' : {}, + 'Slot' : {'attr': 'partition'}, 'CRC32' : {}, - 'Error' : {'attr': 'error'} + 'Error' : {} } @property def ipmitool_args(self): """ """ - return ["cxoem", "fw", "check", self._params['slot']] + return ["cxoem", "fw", "check", self._params['partition']] class FWCancelCommand(CommandWithErrors): @@ -231,7 +234,8 @@ class FWInfoCommand(CommandWithErrors): response_parser = ResponseParserMixIn.parse_colon_record_list response_fields = { - "Slot" : {}, + "Partition" : {}, + "Slot" : {"attr": "partition"}, "Type" : {}, "Offset" : {}, "Size" : {}, |