|
|
d67cb5 |
From 0981cfd54d6dbfb0bf5af536ed2c77b0594f13bb Mon Sep 17 00:00:00 2001
|
|
|
d67cb5 |
From: Marek 'marx' Grac <mgrac@redhat.com>
|
|
|
d67cb5 |
Date: Wed, 28 Aug 2013 14:17:04 +0200
|
|
|
d67cb5 |
Subject: [PATCH 6/6] fence_bladecenter: Fix telnet login failure
|
|
|
d67cb5 |
|
|
|
d67cb5 |
Problem occured due to fact that welcome message contains string which looks like login prompt.
|
|
|
d67cb5 |
|
|
|
d67cb5 |
Resolves: rhbz#997416
|
|
|
d67cb5 |
---
|
|
|
d67cb5 |
fence/agents/bladecenter/fence_bladecenter.py | 2 +-
|
|
|
d67cb5 |
fence/agents/lib/fencing.py.py | 5 ++---
|
|
|
d67cb5 |
2 files changed, 3 insertions(+), 4 deletions(-)
|
|
|
d67cb5 |
|
|
|
d67cb5 |
diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py
|
|
|
d67cb5 |
index e199dee..40d7136 100644
|
|
|
d67cb5 |
--- a/fence/agents/bladecenter/fence_bladecenter.py
|
|
|
d67cb5 |
+++ b/fence/agents/bladecenter/fence_bladecenter.py
|
|
|
d67cb5 |
@@ -100,7 +100,7 @@ and uses the command line interface to power on and off blades."
|
|
|
d67cb5 |
##
|
|
|
d67cb5 |
## Operate the fencing device
|
|
|
d67cb5 |
######
|
|
|
d67cb5 |
- conn = fence_login(options)
|
|
|
d67cb5 |
+ conn = fence_login(options, "(username: )")
|
|
|
d67cb5 |
result = fence_action(conn, options, set_power_status, get_power_status, get_blades_list)
|
|
|
d67cb5 |
|
|
|
d67cb5 |
##
|
|
|
d67cb5 |
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
|
|
|
d67cb5 |
index c896e90..2131d6d 100644
|
|
|
d67cb5 |
--- a/fence/agents/lib/fencing.py.py
|
|
|
d67cb5 |
+++ b/fence/agents/lib/fencing.py.py
|
|
|
d67cb5 |
@@ -950,8 +950,8 @@ def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list = None
|
|
|
d67cb5 |
|
|
|
d67cb5 |
return result
|
|
|
d67cb5 |
|
|
|
d67cb5 |
-def fence_login(options):
|
|
|
d67cb5 |
- force_ipvx = ""
|
|
|
d67cb5 |
+def fence_login(options, re_login_string = "(login\s*: )|(Login Name: )|(username: )|(User Name :)"):
|
|
|
d67cb5 |
+ force_ipvx=""
|
|
|
d67cb5 |
|
|
|
d67cb5 |
if (options.has_key("--inet6-only")):
|
|
|
d67cb5 |
force_ipvx = "-6 "
|
|
|
d67cb5 |
@@ -971,7 +971,6 @@ def fence_login(options):
|
|
|
d67cb5 |
time.sleep(int(options["--delay"]))
|
|
|
d67cb5 |
|
|
|
d67cb5 |
try:
|
|
|
d67cb5 |
- re_login_string = "(login\s*: )|(Login Name: )|(username: )|(User Name :)"
|
|
|
d67cb5 |
re_login = re.compile(re_login_string, re.IGNORECASE)
|
|
|
d67cb5 |
re_pass = re.compile("(password)|(pass phrase)", re.IGNORECASE)
|
|
|
d67cb5 |
|
|
|
d67cb5 |
--
|
|
|
d67cb5 |
1.7.7.6
|
|
|
d67cb5 |
|