|
|
d67cb5 |
From 9568720a6230f1d918eaf30a53860a0865ff1f32 Mon Sep 17 00:00:00 2001
|
|
|
d67cb5 |
From: Marek 'marx' Grac <mgrac@redhat.com>
|
|
|
d67cb5 |
Date: Wed, 31 Jul 2013 14:15:58 +0200
|
|
|
d67cb5 |
Subject: [PATCH 1/6] fence_ilo2: Unable to login when password contains "
|
|
|
d67cb5 |
|
|
|
d67cb5 |
Resolves: rhbz#990537
|
|
|
d67cb5 |
---
|
|
|
d67cb5 |
fence/agents/ilo/fence_ilo.py | 13 +++++++------
|
|
|
d67cb5 |
1 files changed, 7 insertions(+), 6 deletions(-)
|
|
|
d67cb5 |
|
|
|
d67cb5 |
diff --git a/fence/agents/ilo/fence_ilo.py b/fence/agents/ilo/fence_ilo.py
|
|
|
d67cb5 |
index 4890daa..f8bf795 100644
|
|
|
d67cb5 |
--- a/fence/agents/ilo/fence_ilo.py
|
|
|
d67cb5 |
+++ b/fence/agents/ilo/fence_ilo.py
|
|
|
d67cb5 |
@@ -12,6 +12,7 @@
|
|
|
d67cb5 |
#####
|
|
|
d67cb5 |
|
|
|
d67cb5 |
import sys, re, pexpect
|
|
|
d67cb5 |
+from xml.sax.saxutils import quoteattr
|
|
|
d67cb5 |
sys.path.append("@FENCEAGENTSLIBDIR@")
|
|
|
d67cb5 |
from fencing import *
|
|
|
d67cb5 |
|
|
|
d67cb5 |
@@ -22,8 +23,8 @@ BUILD_DATE="March, 2008"
|
|
|
d67cb5 |
#END_VERSION_GENERATION
|
|
|
d67cb5 |
|
|
|
d67cb5 |
def get_power_status(conn, options):
|
|
|
d67cb5 |
- conn.send("
|
|
|
d67cb5 |
- " PASSWORD = \"" + options["--password"] + "\">\r\n")
|
|
|
d67cb5 |
+ conn.send("
|
|
|
d67cb5 |
+ " PASSWORD = " + quoteattr(options["--password"]) + ">\r\n")
|
|
|
d67cb5 |
conn.send("<SERVER_INFO MODE = \"read\"><GET_HOST_POWER_STATUS/>\r\n")
|
|
|
d67cb5 |
conn.send("</SERVER_INFO></LOGIN>\r\n")
|
|
|
d67cb5 |
conn.log_expect(options, "HOST_POWER=\"(.*?)\"", int(options["--power-timeout"]))
|
|
|
d67cb5 |
@@ -32,8 +33,8 @@ def get_power_status(conn, options):
|
|
|
d67cb5 |
return status.lower().strip()
|
|
|
d67cb5 |
|
|
|
d67cb5 |
def set_power_status(conn, options):
|
|
|
d67cb5 |
- conn.send("
|
|
|
d67cb5 |
- " PASSWORD = \"" + options["--password"] + "\">\r\n")
|
|
|
d67cb5 |
+ conn.send("
|
|
|
d67cb5 |
+ " PASSWORD = " + quoteattr(options["--password"]) + ">\r\n")
|
|
|
d67cb5 |
conn.send("<SERVER_INFO MODE = \"write\">")
|
|
|
d67cb5 |
|
|
|
d67cb5 |
if options.has_key("fw_processor") and options["fw_processor"] == "iLO2":
|
|
|
d67cb5 |
@@ -101,8 +102,8 @@ the iLO card through an XML stream."
|
|
|
d67cb5 |
else:
|
|
|
d67cb5 |
conn.send("<RIBCL VERSION=\"1.2\">\r\n")
|
|
|
d67cb5 |
|
|
|
d67cb5 |
- conn.send("
|
|
|
d67cb5 |
- " PASSWORD = \"" + options["--password"] + "\">\r\n")
|
|
|
d67cb5 |
+ conn.send("
|
|
|
d67cb5 |
+ " PASSWORD = " + quoteattr(options["--password"]) + ">\r\n")
|
|
|
d67cb5 |
if options["--ribcl-version"] >= 2:
|
|
|
d67cb5 |
conn.send("<RIB_INFO MODE=\"read\"><GET_FW_VERSION />\r\n")
|
|
|
d67cb5 |
conn.send("</RIB_INFO>\r\n")
|
|
|
d67cb5 |
--
|
|
|
d67cb5 |
1.7.7.6
|
|
|
d67cb5 |
|