From 60756d9b4127aeb2a78e871972f0f675e6e601ed Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 20 Jul 2017 10:12:53 -0400 Subject: [PATCH] Fix handling of numeric enclosure.bay enclosure.bay is integer rather than string now. Fix the filter to use format, which is more robust in numeric versus string anyway. Also, consistently make the underlying data integer rather than sometimes string. --- confluent_server/confluent/discovery/core.py | 2 +- confluent_server/confluent/discovery/handlers/xcc.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/discovery/core.py b/confluent_server/confluent/discovery/core.py index b2c6ff4f..e8fd1fa9 100644 --- a/confluent_server/confluent/discovery/core.py +++ b/confluent_server/confluent/discovery/core.py @@ -608,7 +608,7 @@ def eval_node(cfg, handler, info, nodename, manual=False): # search for nodes fitting our description using filters # lead with the most specific to have a small second pass nl = cfg.filter_node_attributes( - 'enclosure.bay=' + info['enclosure.bay'], nl) + 'enclosure.bay={0}'.format(info['enclosure.bay']), nl) nl = list(nl) if len(nl) != 1: info['discofailure'] = 'ambigconfig' diff --git a/confluent_server/confluent/discovery/handlers/xcc.py b/confluent_server/confluent/discovery/handlers/xcc.py index 1337f33a..de80b9f2 100644 --- a/confluent_server/confluent/discovery/handlers/xcc.py +++ b/confluent_server/confluent/discovery/handlers/xcc.py @@ -58,7 +58,7 @@ class NodeHandler(bmchandler.NodeHandler): '/v2/cmm/sp/7') if not bayid: return - self.info['enclosure.bay'] = bayid + self.info['enclosure.bay'] = int(bayid) smmid = ipmicmd._oem.immhandler.get_property( '/v2/ibmc/smm/chassis/uuid') if not smmid: