diff options
author | George Kraft <george.kraft@calxeda.com> | 2013-05-03 13:12:35 -0500 |
---|---|---|
committer | George Kraft <george.kraft@calxeda.com> | 2013-05-03 13:12:35 -0500 |
commit | 4eb0f85f72677055be1d27083ea64d2726c82d72 (patch) | |
tree | d853d01c5a18824eb27ae8f618a27834b7954063 | |
parent | c3471b15c8bbda69898db1e99d26a913937bd97c (diff) | |
download | cxmanage-4eb0f85f72677055be1d27083ea64d2726c82d72.tar.gz |
Fabric: Simplify get_firmware_info_dict and get_versions_dict
Instead of building up the dictionaries ourselves, let's use the
Node method that already does that for us.
-rw-r--r-- | cxmanage_api/fabric.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/cxmanage_api/fabric.py b/cxmanage_api/fabric.py index e7b0579..aa5e649 100644 --- a/cxmanage_api/fabric.py +++ b/cxmanage_api/fabric.py @@ -363,14 +363,11 @@ class Fabric(object): is returned or a Command object (can get status, etc.). :type async: boolean - :return: THe firmware info for all nodes. + :return: The firmware info for all nodes. :rtype: dictionary or `Task <tasks.html>`__ """ - results = {} - for node_number, info in self.get_firmware_info(async=async).items(): - results[node_number] = [vars(partition) for partition in info] - return results + return self._run_on_all_nodes(async, "get_firmware_info_dict") def is_updatable(self, package, partition_arg="INACTIVE", priority=None, async=False): @@ -525,10 +522,7 @@ class Fabric(object): :rtype: dictionary or `Task <tasks.html>`__ """ - results = {} - for node_number, info in self.get_versions(async=async).items(): - results[node_number] = vars(info) - return results + return self._run_on_all_nodes(async, "get_versions_dict") def ipmitool_command(self, ipmitool_args, asynchronous=False): """Run an arbitrary IPMItool command on all nodes. |