diff --git a/confluent_server/confluent/discovery/handlers/bmc.py b/confluent_server/confluent/discovery/handlers/bmc.py index 62e12e4b..7d6c67b5 100644 --- a/confluent_server/confluent/discovery/handlers/bmc.py +++ b/confluent_server/confluent/discovery/handlers/bmc.py @@ -43,6 +43,9 @@ class NodeHandler(generic.NodeHandler): # TODO(jjohnson2): probe serial number and uuid def config(self, nodename, reset=False): + self._bmcconfig(nodename, reset) + + def _bmcconfig(self, nodename, reset=False): # TODO(jjohnson2): set ip parameters, user/pass, alert cfg maybe # In general, try to use https automation, to make it consistent # between hypothetical secure path and today. @@ -150,4 +153,4 @@ class NodeHandler(generic.NodeHandler): raise if reset: ic.reset_bmc() - return + return ic diff --git a/confluent_server/confluent/discovery/handlers/xcc.py b/confluent_server/confluent/discovery/handlers/xcc.py index ddcf2c9a..59d6ca99 100644 --- a/confluent_server/confluent/discovery/handlers/xcc.py +++ b/confluent_server/confluent/discovery/handlers/xcc.py @@ -39,6 +39,27 @@ class NodeHandler(immhandler.NodeHandler): #if ipmicmd: # ipmicmd.ipmi_session.logout() + def config(self, nodename, reset=False): + # TODO(jjohnson2): set ip parameters, user/pass, alert cfg maybe + # In general, try to use https automation, to make it consistent + # between hypothetical secure path and today. + ic = self._bmcconfig(nodename) + ff = self.info.get('attributes', {}).get('enclosure-form-factor', '') + if ff not in ('dense-computing', [u'dense-computing']): + return + # Ok, we can get the enclosure uuid now.. + ic.oem_init() + enclosureuuid = ic._oem.xcchandler.get_property( + '/v2/ibmc/smm/chassis/uuid') + enclosureuuid = ic._oem.get_property('/v2/ibmc/smm/chassis/uuid') + if enclosureuuid: + em = self.configmanager.get_node_attributes(nodename, + 'enclosure.manager') + em = em.get(nodename, {}).get('enclosure.manager', {}).get( + 'value', None) + # ok, set the uuid of the manager... + if em: + self.configmanager.set_node_attributes(em, {'id.uuid': em}) # TODO(jjohnson2): web based init config for future prevalidated cert scheme # def config(self, nodename):