From d4357c6984289648a7f668969c1904a676c171aa Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 12 Apr 2016 13:04:02 -0400 Subject: [PATCH] Avoid double-removal of attrib watcher in ipmi IPMI plugin was issuing redundant calls to remove the same watcher. Track that a session has already unhooked to avoid double unhook (which runs at least a slight risk of unhooking the wrong handler (*if* it were allowed). --- confluent_server/confluent/plugins/hardwaremanagement/ipmi.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 9142fdc8..561a6ad6 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -105,7 +105,9 @@ class IpmiCommandWrapper(ipmicommand.Command): self.cfm, self.node, 'pubkeys.tls_hardwaremanager').verify_cert) def close_confluent(self): - self.cfm.remove_watcher(self._attribwatcher) + if self._attribwatcher: + self.cfm.remove_watcher(self._attribwatcher) + self._attribwatcher = None def _attribschanged(self, nodeattribs, configmanager, **kwargs): try: