Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=d0c2a2ec6... Commit: d0c2a2ec6a553d6341e199592284f180a6824593 Parent: c399203557e791f7e92e838c948a1b7d5582d7cd Author: Marek 'marx' Grac mgrac@redhat.com AuthorDate: Wed Feb 6 16:27:01 2013 +0100 Committer: Marek 'marx' Grac mgrac@redhat.com CommitterDate: Fri Jun 28 10:52:59 2013 +0200
fence_cisco_ucs: Fix traceback when hostname cannot be resolved to IP address
Resolves: rhbz#978326 --- fence/agents/cisco_ucs/fence_cisco_ucs.py | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py b/fence/agents/cisco_ucs/fence_cisco_ucs.py index 19b2086..0be06a0 100644 --- a/fence/agents/cisco_ucs/fence_cisco_ucs.py +++ b/fence/agents/cisco_ucs/fence_cisco_ucs.py @@ -120,13 +120,17 @@ used with Cisco UCS to fence machines." if options["-o"] in ["off", "reboot"]: time.sleep(int(options["-f"]))
- res = send_command(options, "<aaaLogin inName="" + options["-l"] + "" inPassword="" + options["-p"] + "" />") - result = re_cookie.search(res) - if (result == None): - ## Cookie is absenting in response + try: + res = send_command(options, "<aaaLogin inName="" + options["-l"] + "" inPassword="" + options["-p"] + "" />", int(options("-y"))) + + result = re_cookie.search(res) + if (result == None): + ## Cookie is absenting in response + fail(EC_LOGIN_DENIED) + except: fail(EC_LOGIN_DENIED)
- options["cookie"] = result.group(1); + options["cookie"] = result.group(1)
## ## Modify suborg to format /suborg
cluster-commits@lists.fedorahosted.org