From: Marek 'marx' Grac Date: Thu, 25 Oct 2012 10:27:23 +0200 Subject: [Cluster-devel] [PATCH 2/3] fence_cisco_ucs: Incorrect timeout was used during login Message-ID: <1351153643-25227-1-git-send-email-mgrac@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Previously, login command was bound with shell_timeout instead of login_timeout. --- fence/agents/cisco_ucs/fence_cisco_ucs.py | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py b/fence/agents/cisco_ucs/fence_cisco_ucs.py index 8020d96..84cb4fd 100644 --- a/fence/agents/cisco_ucs/fence_cisco_ucs.py +++ b/fence/agents/cisco_ucs/fence_cisco_ucs.py @@ -18,7 +18,7 @@ re_get_desc = re.compile(" descr=\"(.*?)\"", re.IGNORECASE) def get_power_status(conn, options): try: - res = send_command(options, "") + res = send_command(options, "", int(options["-Y"])) except pycurl.error, e: sys.stderr.write(e[1] + "\n") fail(EC_TIMED_OUT) @@ -41,7 +41,7 @@ def set_power_status(conn, options): }[options["-o"]] try: - res = send_command(options, "") + res = send_command(options, "", int(options["-Y"])) except pycurl.error, e: sys.stderr.write(e[1] + "\n") fail(EC_TIMED_OUT) @@ -53,7 +53,7 @@ def get_list(conn, options): try: try: - res = send_command(options, "") + res = send_command(options, "", int(options["-Y"])) except pycurl.error, e: sys.stderr.write(e[1] + "\n") fail(EC_TIMED_OUT) @@ -70,7 +70,7 @@ def get_list(conn, options): return outlets -def send_command(opt, command): +def send_command(opt, command, timeout): ## setup correct URL if opt.has_key("-z"): url = "https:" @@ -86,7 +86,7 @@ def send_command(opt, command): c.setopt(pycurl.HTTPHEADER, [ "Content-type: text/xml" ]) c.setopt(pycurl.POSTFIELDS, command) c.setopt(pycurl.WRITEFUNCTION, b.write) - c.setopt(pycurl.TIMEOUT, int(opt["-Y"])) + c.setopt(pycurl.TIMEOUT, timeout) c.setopt(pycurl.SSL_VERIFYPEER, 0) c.setopt(pycurl.SSL_VERIFYHOST, 0) c.perform() @@ -115,7 +115,7 @@ used with Cisco UCS to fence machines." show_docs(options, docs) ### Login - res = send_command(options, "") + res = send_command(options, "", int(options["-y"])) result = re_cookie.search(res) if (result == None): ## Cookie is absenting in response @@ -137,7 +137,7 @@ used with Cisco UCS to fence machines." result = fence_action(None, options, set_power_status, get_power_status, get_list) ### Logout; we do not care about result as we will end in any case - send_command(options, "") + send_command(options, "", int(options["-Y"])) sys.exit(result) -- 1.7.7.6