From 8226c2bd770bf99b5cdfd81973f8bfeba8d40599 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 16 Jan 2018 12:13:34 -0500 Subject: [PATCH] Fix mistakes in the draft discovery code A couple of blatantly obvious mistakes were made that require fixing. --- confluent_server/confluent/discovery/core.py | 2 +- confluent_server/confluent/networking/macmap.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/discovery/core.py b/confluent_server/confluent/discovery/core.py index 8abfb017..82ba1c0b 100644 --- a/confluent_server/confluent/discovery/core.py +++ b/confluent_server/confluent/discovery/core.py @@ -684,7 +684,7 @@ def get_chained_smm_name(nodename, cfg, handler, nl=None, checkswitch=True): cd = cfg.get_node_attributes(nodename, ['hardwaremanagement.manager', 'pubkeys.tls_hardwaremanager']) smmaddr = cd[nodename]['hardwaremanagement.manager']['value'] - pkey = cd.get[nodename].get('pubkeys.tls_hardwaremanager', {}).get( + pkey = cd[nodename].get('pubkeys.tls_hardwaremanager', {}).get( 'value', None) if pkey: cv = util.TLSCertVerifier( diff --git a/confluent_server/confluent/networking/macmap.py b/confluent_server/confluent/networking/macmap.py index 67bca895..652b4dde 100644 --- a/confluent_server/confluent/networking/macmap.py +++ b/confluent_server/confluent/networking/macmap.py @@ -254,7 +254,9 @@ def find_nodeinfo_by_mac(mac, configmanager): if mac in _nodesbymac: return _nodesbymac[mac][0], {'maccount': _nodesbymac[mac][1]} # If update_mac bailed out, still check one last time - return _nodesbymac.get(mac, (None, {'maccount': 0})) + if mac in _nodesbymac: + return _nodesbymac[mac][0], {'maccount': _nodesbymac[mac][1]} + return None, {'maccount': 0} mapupdating = eventlet.semaphore.Semaphore()