2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-29 00:31:09 +00:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Jarrod Johnson 4b7d042f2d Have a clause for redfish not yet ready
We need redfish, but redfish is slow to boot on TSM..
2020-09-23 08:24:18 -04:00
Jarrod Johnson 99f533b4cb Implement redfish resilient discovery for TSM
TSM redfish stack has an issue where it refuses to recognize any
non-redfish password change. Use redfish to change.

Regretably, it takes about 10 seconds for that change to propogate
to the practical API, so we have a discovery delay now.
2020-09-23 08:24:07 -04:00
Jarrod Johnson 9828ea5898 Fix chained smm discovery on cumulus 2020-09-14 11:02:00 -04:00
Jarrod Johnson 7bdf7afb80 Fix another mistake in chained SMM discovery 2020-09-14 08:04:41 -04:00
Jarrod Johnson cd20a69eb6 Fix typo in function name in chained smm discovery 2020-09-14 08:03:18 -04:00
3 changed files with 27 additions and 4 deletions
+7 -3
View File
@@ -1020,9 +1020,13 @@ def eval_node(cfg, handler, info, nodename, manual=False):
if nl:
# The candidate nodename is the head of a chain, we must
# validate the smm certificate by the switch
macmap.get_node_fingerprint(nodename, cfg)
util.handler.cert_matches(fprint, handler.https_cert)
return
fprints = macmap.get_node_fingerprints(nodename, cfg)
for fprint in fprints:
if util.cert_matches(fprint[0], handler.https_cert):
if not discover_node(cfg, handler, info,
nodename, manual):
pending_nodes[nodename] = info
return
if (info.get('maccount', False) and
not handler.discoverable_by_switch(info['maccount'])):
errorstr = 'The detected node {0} was detected using switch, ' \
@@ -16,6 +16,7 @@ import confluent.discovery.handlers.generic as generic
import confluent.exceptions as exc
import confluent.netutil as netutil
import confluent.util as util
import eventlet
import eventlet.support.greendns
import json
try:
@@ -85,7 +86,24 @@ class NodeHandler(generic.NodeHandler):
'username': self.DEFAULT_USER
}
if authmode == 2:
rsp, status = wc.grab_json_response_with_status('/api/reset-pass', passchange)
passchange = {
'Password': self.targpass,
}
rwc = webclient.SecureHTTPConnection(
self.ipaddr, 443,
verifycallback=self.validate_cert)
rwc.set_basic_credentials(authdata['username'],
authdata['password'])
rwc.set_header('If-Match', '*')
rwc.set_header('Content-Type', 'application/json')
rsp, status = rwc.grab_json_response_with_status(
'/redfish/v1/AccountService/Accounts/1',
passchange, method='PATCH')
if status >= 200 and status < 300:
authdata['password'] = self.targpass
eventlet.sleep(10)
else:
raise Exception("Redfish may not have been ready yet")
else:
rsp, status = wc.grab_json_response_with_status('/api/reset-pass', urlencode(passchange))
authdata['password'] = self.targpass
@@ -199,6 +199,7 @@ def _extract_neighbor_data_affluent(switch, user, password, cfm, lldpdata):
'port': record['localport'],
'peerid': peerid,
}
_extract_extended_desc(portdata, portdata['peerdescription'], True)
_neighbypeerid[peerid] = portdata
lldpdata[localport] = portdata
neighdata[switch] = lldpdata