2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 11:01:09 +00:00

Add model name to discovery info

Sometimes the model name is
useful criteria for evaluating systems,
and the model number isn't
quite that handy.

For XCC, we can provide this data too. Provide it in xcc scan
method and then offer it up to clients.
This commit is contained in:
Jarrod Johnson 2021-04-22 13:38:30 -04:00
parent c38aac88df
commit b7af6b5c27
3 changed files with 11 additions and 0 deletions

View File

@ -34,6 +34,7 @@ defcolumns = ['Node', 'Model', 'Serial', 'UUID', 'Mac Address', 'Type',
columnmapping = {
'Node': 'nodename',
'Model': 'modelnumber',
'Model Name': 'modelname',
'Serial': 'serialnumber',
'UUID': 'uuid',
'Type': 'types',

View File

@ -252,6 +252,8 @@ def send_discovery_datum(info):
yield msg.KeyValueData({'lowest_u': info['u']})
if 'hostname' in info:
yield msg.KeyValueData({'hostname': info['hostname']})
if 'modelname' in info:
yield msg.KeyValueData({'modelname': info['modelname']})
def _info_matches(info, criteria):

View File

@ -63,6 +63,14 @@ class NodeHandler(immhandler.NodeHandler):
# This is not adequate for being satisfied
return bool(info.get('attributes', {}))
def scan(self):
c = webclient.SecureHTTPConnection(self.ipaddr, 443,
verifycallback=self.validate_cert)
i = c.grab_json_response('/api/providers/logoninfo')
modelname = i.get('items', [{}])[0].get('machine_name', None)
if modelname:
self.info['modelname'] = modelname
def preconfig(self, possiblenode):
self.tmpnodename = possiblenode
ff = self.info.get('attributes', {}).get('enclosure-form-factor', '')