From 3372a8401a6efe11348ea183f60e3c603f7c5293 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 20 Oct 2017 15:18:03 -0400 Subject: [PATCH] Move registration of key handler up to constructor This should be a more bulletproof place to be. Note that it used to be here and was moved because pyghmi used to call oem_init, but pyghmi has been changed for a long time to no longer have that requirement. --- confluent_server/confluent/plugins/hardwaremanagement/ipmi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index dfce365e..e0403587 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -135,6 +135,7 @@ class IpmiCommandWrapper(ipmicommand.Command): 'secret.hardwaremanagementpassword', 'secret.ipmikg', 'hardwaremanagement.manager'), self._attribschanged) super(self.__class__, self).__init__(**kwargs) + self.setup_confluent_keyhandler() def setup_confluent_keyhandler(self): self.register_key_handler(util.TLSCertVerifier( @@ -387,6 +388,7 @@ class IpmiHandler(object): userid=connparams['username'], password=connparams['passphrase'], kg=connparams['kg'], port=connparams['port'], onlogon=self.logged) + ipmisess = persistent_ipmicmds[(node, tenant)].ipmi_session begin = util.monotonic_time() while ((not (self.broken or self.loggedin)) and @@ -412,7 +414,6 @@ class IpmiHandler(object): else: self.ipmicmd = ipmicmd self.loggedin = True - self.ipmicmd.setup_confluent_keyhandler() def handle_request(self): if self.broken: