2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

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.
This commit is contained in:
Jarrod Johnson 2017-10-20 15:18:03 -04:00
parent f07a0e333f
commit 3372a8401a

View File

@ -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: