From 950abde20e29f8318987628f35ea78697f8716c6 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 30 Oct 2018 10:05:48 -0400 Subject: [PATCH] Remove 'all' from storage subelements This concept is potentially problematic, as a volume named 'all' is valid. Additionally, if really wanting all, the caller probably wants the full storage configuration, better provide that up a level to avoid requiring many calls to do that. --- .../confluent/plugins/hardwaremanagement/ipmi.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 6b6ba079..e36593c5 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -1052,8 +1052,7 @@ class IpmiHandler(object): def show_disk(self, name): scfg = self.ipmicmd.get_storage_configuration() for disk in scfg.disks: - if (name == 'all' or simplify_name(disk.name) == name or - disk == name): + if simplify_name(disk.name) == name or disk == name: self.output.put( msg.Disk(self.node, disk.name, disk.description, disk.id, disk.status, disk.serial, @@ -1070,7 +1069,6 @@ class IpmiHandler(object): def list_disks(self): scfg = self.ipmicmd.get_storage_configuration() - self.output.put(msg.ChildCollection('all')) for disk in scfg.disks: self.output.put(msg.ChildCollection(simplify_name(disk.name))) for arr in scfg.arrays: @@ -1079,7 +1077,6 @@ class IpmiHandler(object): def list_arrays(self): scfg = self.ipmicmd.get_storage_configuration() - self.output.put(msg.ChildCollection('all')) for arr in scfg.arrays: self.output.put(msg.ChildCollection('{0}-{1}'.format(*arr.id))) @@ -1109,7 +1106,6 @@ class IpmiHandler(object): def list_volumes(self): scfg = self.ipmicmd.get_storage_configuration() - self.output.put(msg.ChildCollection('all')) for arr in scfg.arrays: for vol in arr.volumes: self.output.put(msg.ChildCollection(simplify_name(vol.name)))