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:
parent
c38aac88df
commit
b7af6b5c27
@ -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',
|
||||
|
@ -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):
|
||||
|
@ -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', '')
|
||||
|
Loading…
Reference in New Issue
Block a user