2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-03-28 13:13:33 +00:00

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.
This commit is contained in:
Jarrod Johnson
2018-10-30 10:05:48 -04:00
parent 37be696f23
commit 950abde20e

View File

@@ -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)))