From 5dc2d8c8be7168e4f589f16ff872ee70195ff816 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 28 Jun 2017 16:21:57 -0400 Subject: [PATCH] Prefer SLP data on probe if available Avoid attempting login on probe if at all possible. --- .../confluent/discovery/handlers/xcc.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/confluent_server/confluent/discovery/handlers/xcc.py b/confluent_server/confluent/discovery/handlers/xcc.py index f12e1569..1337f33a 100644 --- a/confluent_server/confluent/discovery/handlers/xcc.py +++ b/confluent_server/confluent/discovery/handlers/xcc.py @@ -15,6 +15,8 @@ import confluent.discovery.handlers.bmc as bmchandler import pyghmi.exceptions as pygexc import pyghmi.ipmi.private.util as pygutil +import string +import struct class NodeHandler(bmchandler.NodeHandler): @@ -22,6 +24,31 @@ class NodeHandler(bmchandler.NodeHandler): def probe(self): try: + slpattrs = self.info.get('attributes', {}) + try: + ff = slpattrs.get('enclosure-form-factor', [''])[0] + except IndexError: + return + if ff != 'dense-computing': + # do not probe unless it's a dense platform + return + wronguuid = slpattrs.get('node-uuid', [''])[0] + if wronguuid: + # we need to fix the first three portions of the uuid + uuidprefix = wronguuid.split('-')[:3] + uuidprefix = struct.pack( + '