From a046e4939ff53b831bf0582d34203c7808273898 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 19 May 2016 16:32:56 -0400 Subject: [PATCH] Fix ping before connection error If ping() was called before connect, an exception was raised. Fix this by returning false in such an event. --- confluent_server/confluent/plugins/hardwaremanagement/ipmi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index e564fbdf..e901328d 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -275,10 +275,13 @@ class IpmiConsole(conapi.Console): self.solconnection.send_break() def ping(self): + if not self.solconnection: + return False rsp = self.solconnection.ipmi_session.raw_command(netfn=6, command=0x4b, data=(1, 1)) self.solconnection._got_payload_instance_info(rsp) + return True def perform_requests(operator, nodes, element, cfg, inputdata):