From 79b6d099ab8196be287f9175591d42b019973a30 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 22 Jan 2020 14:24:10 -0500 Subject: [PATCH 1/3] Fix attribute sort with python 3 For attributes without a sortid, sort was failing with python3 --- confluent_client/confluent/client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/confluent_client/confluent/client.py b/confluent_client/confluent/client.py index 578ab212..3ee2712c 100644 --- a/confluent_client/confluent/client.py +++ b/confluent_client/confluent/client.py @@ -429,6 +429,10 @@ def printattributes(session, requestargs, showtype, nodetype, noderange, options path = '/{0}/{1}/attributes/{2}'.format(nodetype, noderange, showtype) return print_attrib_path(path, session, requestargs, options) +def _sort_attrib(k): + if isinstance(k[1], dict) and k[1].get('sortid', None) is not None: + return k[1]['sortid'] + return k[0] def print_attrib_path(path, session, requestargs, options, rename=None, attrprefix=None): exitcode = 0 @@ -439,9 +443,7 @@ def print_attrib_path(path, session, requestargs, options, rename=None, attrpref exitcode = 1 continue for node in sorted(res['databynode']): - for attr, val in sorted( - res['databynode'][node].items(), - key=lambda k: k[1].get('sortid', k[0]) if isinstance(k[1], dict) else k[0]): + for attr, val in sorted(res['databynode'][node].items(), key=_sort_attrib): if attr == 'error': sys.stderr.write('{0}: Error: {1}\n'.format(node, val)) continue From 47b68e4258fa5c2b1ba9fd594a80c58f67a30a01 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 22 Jan 2020 15:04:43 -0500 Subject: [PATCH 2/3] Fix dispatch of redfish and tsmsol redfish and tsmsol was not properly marked as needing dispatch. --- confluent_server/confluent/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index 575d2e19..17e47e7b 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -72,7 +72,7 @@ import struct import sys pluginmap = {} -dispatch_plugins = (b'ipmi', u'ipmi') +dispatch_plugins = (b'ipmi', u'ipmi', b'redfish', u'redfish', b'tsmsol', u'tsmsol') def seek_element(currplace, currkey): From 18b6398c64dfd99f244f58ef49928445b450fdc3 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 23 Jan 2020 08:44:17 -0500 Subject: [PATCH 3/3] Fix XCC discovery issues A couple of issues could occur during discover that should be stepped over. --- confluent_server/confluent/discovery/handlers/xcc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/discovery/handlers/xcc.py b/confluent_server/confluent/discovery/handlers/xcc.py index d09b84bf..8f357acf 100644 --- a/confluent_server/confluent/discovery/handlers/xcc.py +++ b/confluent_server/confluent/discovery/handlers/xcc.py @@ -15,6 +15,7 @@ import base64 import codecs import confluent.discovery.handlers.imm as immhandler +import confluent.exceptions as exc import confluent.netutil as netutil import confluent.util as util import errno @@ -95,7 +96,8 @@ class NodeHandler(immhandler.NodeHandler): ipmicmd.xraw_command(netfn=0x3a, command=0xf1, data=(1,)) except pygexc.IpmiException as e: if (e.ipmicode != 193 and 'Unauthorized name' not in str(e) and - 'Incorrect password' not in str(e)): + 'Incorrect password' not in str(e) and + str(e) != 'Session no longer connected'): # raise an issue if anything other than to be expected if disableipmi: _, _ = wc.grab_json_response_with_status(