From 39cd741845b795140b70e122255cbc1126a1a025 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 12 Sep 2013 15:52:34 -0400 Subject: [PATCH] Correct various issues and IPMI console session actually go through now --- confluent/pluginapi.py | 2 +- plugins/ipmi.py | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/confluent/pluginapi.py b/confluent/pluginapi.py index d0033063..33a78b5e 100644 --- a/confluent/pluginapi.py +++ b/confluent/pluginapi.py @@ -88,7 +88,7 @@ def handle_path(path, operation, configmanager): for attrname in plugroute['pluginattrs']: if attrname in nodeattr[node]: return pluginmap[nodeattr[node][attrname]['value']].__dict__[operation]( - node=(node), operation=operation, + nodes=(node,), element=element, configmanager=configmanager) diff --git a/plugins/ipmi.py b/plugins/ipmi.py index bf66b08e..ddeb3473 100644 --- a/plugins/ipmi.py +++ b/plugins/ipmi.py @@ -1,16 +1,16 @@ import eventlet -console = eventlet.import_patched('pyghmi.ipmi.console') -ipmisession = eventlet.import_patched('pyghmi.ipmi.private.session') +import pyghmi.ipmi.console as console +console.session.select = eventlet.green.select _loopthread = None def _ipmi_evtloop(): while (1): - ipmisession.Session.wait_for_rsp(timeout=600) + console.session.Session.wait_for_rsp(timeout=600) -def get_conn_params(node, config): +def get_conn_params(node, configdata): if 'secret.ipmiuser' in configdata: username = configdata['secret.ipmiuser']['value'] elif 'secret.managementuser' in configdata: @@ -18,13 +18,13 @@ def get_conn_params(node, config): else: username = 'USERID' if 'secret.ipmipassphrase' in configdata: - passphrase = configddata['secret.ipmi.passphrase']['value'] + passphrase = configdata['secret.ipmipassphrase']['value'] elif 'secret.managementpassphrase' in configdata: - passphrase = configdata['secret.managementpassphrase'] + passphrase = configdata['secret.managementpassphrase']['value'] else: passphrase = 'PASSW0RD' # for lack of a better guess - if configdata['hardwaremanagement.manager']: - bmc = configdata['hardwaremanagement.manager'] + if 'hardwaremanagement.manager' in configdata: + bmc = configdata['hardwaremanagement.manager']['value'] else: bmc = node if 'secret.ipmikg' in configdata: @@ -43,7 +43,7 @@ def get_conn_params(node, config): class Console(object): - def __init__(node, config): + def __init__(self, node, config): crypt = config.decrypt config.decrypt = True configdata = config.get_node_attributes([node], @@ -59,9 +59,10 @@ class Console(object): # Cannot actually create console until 'connect', when we get callback def connect(self,callback): + global _loopthread self.solconnection = console.Console(bmc=self.bmc, port=self.port, - username=self.username, + userid=self.username, password=self.password, kg=self.kg, iohandler=callback)