From b5213e6972499e2d22c841a09b6113fc5648a740 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 16 Nov 2018 11:19:27 -0500 Subject: [PATCH] Show data about created volumes upon volume completion. Provide concrete feedback as to the results of the creation operation. --- .../plugins/hardwaremanagement/ipmi.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index f37803a8..6f10e570 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -969,6 +969,11 @@ class IpmiHandler(object): vols = [] thedisks = None currcfg = self.ipmicmd.get_storage_configuration() + currnames = [] + for arr in currcfg.arrays: + arrname = '{0}-{1}'.format(*arr.id) + for vol in arr.volumes: + currnames.append(vol.name) disks = [] vols = [] vol = self.inputdata.inputbynode[self.node][0] @@ -993,7 +998,19 @@ class IpmiHandler(object): newcfg = storage.ConfigSpec( arrays=(storage.Array(raid=raidlvl, disks=disks, volumes=vols),)) self.ipmicmd.apply_storage_configuration(newcfg) - return self._show_storage(storelem) + for vol in self.inputdata.inputbynode[self.node]: + if vol['name'] is None: + newcfg = self.ipmicmd.get_storage_configuration() + for arr in newcfg.arrays: + arrname = '{0}-{1}'.format(*arr.id) + for vol in arr.volumes: + if vol.name not in currnames: + self.output.put( + msg.Volume(self.node, vol.name, vol.size, + vol.status, arrname)) + return + else: + self._show_storage(storelem[:1] + [vol['name']]) def _update_storage(self, storelem): if storelem[0] == 'disks':