fence-agents: master - library: Properly escape XML also in getopt mixed=".."

Marek GrĂ¡c marx at fedoraproject.org
Mon Dec 8 15:14:16 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=321a214d48eebfe94d0923d5a08195621a8682bc
Commit:        321a214d48eebfe94d0923d5a08195621a8682bc
Parent:        8cc5231e23406e24ea0136223c2a548e41aca5a2
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Mon Dec 8 16:13:22 2014 +0100
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Mon Dec 8 16:13:22 2014 +0100

library: Properly escape XML also in getopt mixed=".."

---
 fence/agents/lib/fencing.py.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 645441f..5449373 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -534,8 +534,7 @@ def metadata(avail_opt, docs):
 			res = re.compile(r"^(.*?--\S+)\s+", re.IGNORECASE | re.S).search(mixed)
 			if None != res:
 				mixed = res.group(1)
-			# @todo: replace with _encode_html_entities but update XML metadata in regression tests
-			mixed = mixed.replace("<", "&lt;").replace(">", "&gt;")
+			mixed = _encode_html_entities(mixed)
 			print "\t\t<getopt mixed=\"" + mixed + "\" />"
 
 			if all_opt[option].has_key("choices"):
@@ -736,7 +735,7 @@ def fence_action(connection, options, set_power_fn, get_power_fn, get_outlet_lis
 		elif (options["--action"] == "list") or \
 				((options["--action"] == "monitor") and 1 == options["device_opt"].count("port")):
 			outlets = get_outlet_list(connection, options)
-			## keys can be numbers (port numbers) or strings (names of VM)
+			## keys can be numbers (port numbers) or strings (names of VM, UUID)
 			for outlet_id in outlets.keys():
 				(alias, status) = outlets[outlet_id]
 				if options["--action"] != "monitor":


More information about the cluster-commits mailing list