Blame SOURCES/bz1214522-3-port_as_ip.patch

e4ffb1
From 3c4651ba655a7346f4e67335229b76ed24d1c917 Mon Sep 17 00:00:00 2001
e4ffb1
From: Marek 'marx' Grac <mgrac@redhat.com>
e4ffb1
Date: Wed, 5 Aug 2015 15:29:12 +0200
e4ffb1
Subject: [PATCH 3/4] fencing: Fix XML metadata and their creation for
e4ffb1
 'port_as_ip'
e4ffb1
e4ffb1
---
e4ffb1
 fence/agents/dummy/fence_dummy.py      |  1 +
e4ffb1
 fence/agents/lib/fencing.py.py         |  5 +++-
e4ffb1
 tests/data/metadata/fence_alom.xml     |  4 +--
e4ffb1
 tests/data/metadata/fence_amt.xml      |  4 +--
e4ffb1
 tests/data/metadata/fence_drac.xml     |  4 +--
e4ffb1
 tests/data/metadata/fence_dummy.xml    | 10 -------
e4ffb1
 tests/data/metadata/fence_idrac.xml    |  4 +--
e4ffb1
 tests/data/metadata/fence_ilo.xml      |  4 +--
e4ffb1
 tests/data/metadata/fence_ilo2.xml     |  4 +--
e4ffb1
 tests/data/metadata/fence_ilo3.xml     |  4 +--
e4ffb1
 tests/data/metadata/fence_ilo3_ssh.xml |  4 +--
e4ffb1
 tests/data/metadata/fence_ilo4.xml     |  4 +--
e4ffb1
 tests/data/metadata/fence_ilo4_ssh.xml |  4 +--
e4ffb1
 tests/data/metadata/fence_ilo_mp.xml   |  4 +--
e4ffb1
 tests/data/metadata/fence_ilo_ssh.xml  |  4 +--
e4ffb1
 tests/data/metadata/fence_imm.xml      |  4 +--
e4ffb1
 tests/data/metadata/fence_ipmilan.xml  |  4 +--
e4ffb1
 tests/data/metadata/fence_mpath.xml    | 54 ++++++++++++++--------------------
e4ffb1
 tests/data/metadata/fence_rsa.xml      |  4 +--
e4ffb1
 tests/data/metadata/fence_rsb.xml      |  4 +--
e4ffb1
 20 files changed, 59 insertions(+), 75 deletions(-)
e4ffb1
e4ffb1
diff --git a/fence/agents/dummy/fence_dummy.py b/fence/agents/dummy/fence_dummy.py
e4ffb1
index 9c4c5f1..7d6bd06 100644
e4ffb1
--- a/fence/agents/dummy/fence_dummy.py
e4ffb1
+++ b/fence/agents/dummy/fence_dummy.py
e4ffb1
@@ -115,6 +115,7 @@ def main():
e4ffb1
 	if (pinput.has_key("--type") and pinput["--type"] == "file") or (pinput.has_key("--type") == False):
e4ffb1
 		# hack to have fence agents that require ports 'fail' and one that do not 'file'
e4ffb1
 		device_opt.remove("port")
e4ffb1
+		device_opt.remove("separator")
e4ffb1
 
e4ffb1
 	options = check_input(device_opt, process_input(device_opt))
e4ffb1
 
e4ffb1
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
e4ffb1
index f14d7e0..8b14cf2 100644
e4ffb1
--- a/fence/agents/lib/fencing.py.py
e4ffb1
+++ b/fence/agents/lib/fencing.py.py
e4ffb1
@@ -463,7 +463,10 @@ def add_dependency_options(options):
e4ffb1
 		if DEPENDENCY_OPT.has_key(opt):
e4ffb1
 			added_opt.extend([y for y in DEPENDENCY_OPT[opt] if options.count(y) == 0])
e4ffb1
 
e4ffb1
-	if not "port" in (options + added_opt) and not "nodename" in (options + added_opt):
e4ffb1
+	if not "port" in (options + added_opt) and \
e4ffb1
+		not "nodename" in (options + added_opt) and \
e4ffb1
+		"ipaddr" in (options + added_opt):
e4ffb1
+
e4ffb1
 		added_opt.append("port_as_ip")
e4ffb1
 		all_opt["port"]["help"] = "-n, --plug=[ip]                IP address or hostname of fencing device " \
e4ffb1
 			"(together with --port-as-ip)"
e4ffb1
diff --git a/tests/data/metadata/fence_alom.xml b/tests/data/metadata/fence_alom.xml
e4ffb1
index dfbe431..f7e2f36 100644
e4ffb1
--- a/tests/data/metadata/fence_alom.xml
e4ffb1
+++ b/tests/data/metadata/fence_alom.xml
e4ffb1
@@ -8,12 +8,12 @@
e4ffb1
 		<content type="string" default="22"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_amt.xml b/tests/data/metadata/fence_amt.xml
e4ffb1
index 17e38fc..61b39f5 100644
e4ffb1
--- a/tests/data/metadata/fence_amt.xml
e4ffb1
+++ b/tests/data/metadata/fence_amt.xml
e4ffb1
@@ -8,7 +8,7 @@
e4ffb1
 		<content type="string" default="23"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
@@ -18,7 +18,7 @@
e4ffb1
 		<content type="boolean"  />
e4ffb1
 		<shortdesc lang="en">Forces agent to use IPv6 addresses only</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_drac.xml b/tests/data/metadata/fence_drac.xml
e4ffb1
index 37697f7..1e94dbc 100644
e4ffb1
--- a/tests/data/metadata/fence_drac.xml
e4ffb1
+++ b/tests/data/metadata/fence_drac.xml
e4ffb1
@@ -8,7 +8,7 @@
e4ffb1
 		<content type="string" default="23"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
@@ -23,7 +23,7 @@
e4ffb1
 		<content type="boolean"  />
e4ffb1
 		<shortdesc lang="en">Forces agent to use IPv6 addresses only</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_dummy.xml b/tests/data/metadata/fence_dummy.xml
e4ffb1
index eb31244..07ad2cc 100644
e4ffb1
--- a/tests/data/metadata/fence_dummy.xml
e4ffb1
+++ b/tests/data/metadata/fence_dummy.xml
e4ffb1
@@ -3,11 +3,6 @@
e4ffb1
 <longdesc>fence_dummy</longdesc>
e4ffb1
 <vendor-url>http://www.example.com</vendor-url>
e4ffb1
 <parameters>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
-		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
-		<content type="string"  />
e4ffb1
-		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
-	</parameter>
e4ffb1
 	<parameter name="status_file" unique="0" required="0">
e4ffb1
 		<getopt mixed="--status-file=[file]" />
e4ffb1
 		<content type="string" default="/tmp/fence_dummy.status"  />
e4ffb1
@@ -63,11 +58,6 @@
e4ffb1
 		<content type="string" default="20"  />
e4ffb1
 		<shortdesc lang="en">Test X seconds for status change after ON/OFF</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port_as_ip" unique="0" required="0">
e4ffb1
-		<getopt mixed="--port-as-ip" />
e4ffb1
-		<content type="boolean"  />
e4ffb1
-		<shortdesc lang="en">Make "port/plug" to be an alias to IP address</shortdesc>
e4ffb1
-	</parameter>
e4ffb1
 	<parameter name="delay" unique="0" required="0">
e4ffb1
 		<getopt mixed="--delay=[seconds]" />
e4ffb1
 		<content type="string" default="0"  />
e4ffb1
diff --git a/tests/data/metadata/fence_idrac.xml b/tests/data/metadata/fence_idrac.xml
e4ffb1
index b742161..0aced2a 100644
e4ffb1
--- a/tests/data/metadata/fence_idrac.xml
e4ffb1
+++ b/tests/data/metadata/fence_idrac.xml
e4ffb1
@@ -12,7 +12,7 @@
e4ffb1
 		<content type="string" default="623"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
@@ -22,7 +22,7 @@
e4ffb1
 		<content type="boolean"  />
e4ffb1
 		<shortdesc lang="en">Forces agent to use IPv6 addresses only</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_ilo.xml b/tests/data/metadata/fence_ilo.xml
e4ffb1
index 891b7f1..2eead1e 100644
e4ffb1
--- a/tests/data/metadata/fence_ilo.xml
e4ffb1
+++ b/tests/data/metadata/fence_ilo.xml
e4ffb1
@@ -34,12 +34,12 @@
e4ffb1
 		<content type="boolean"  />
e4ffb1
 		<shortdesc lang="en">Forces agent to use IPv6 addresses only</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_ilo2.xml b/tests/data/metadata/fence_ilo2.xml
e4ffb1
index 7ff697f..3be62f1 100644
e4ffb1
--- a/tests/data/metadata/fence_ilo2.xml
e4ffb1
+++ b/tests/data/metadata/fence_ilo2.xml
e4ffb1
@@ -34,12 +34,12 @@
e4ffb1
 		<content type="boolean"  />
e4ffb1
 		<shortdesc lang="en">Forces agent to use IPv6 addresses only</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_ilo3.xml b/tests/data/metadata/fence_ilo3.xml
e4ffb1
index 05fd01c..67e869b 100644
e4ffb1
--- a/tests/data/metadata/fence_ilo3.xml
e4ffb1
+++ b/tests/data/metadata/fence_ilo3.xml
e4ffb1
@@ -12,7 +12,7 @@
e4ffb1
 		<content type="string" default="623"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
@@ -22,7 +22,7 @@
e4ffb1
 		<content type="boolean"  />
e4ffb1
 		<shortdesc lang="en">Forces agent to use IPv6 addresses only</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_ilo3_ssh.xml b/tests/data/metadata/fence_ilo3_ssh.xml
e4ffb1
index ebdae65..8268daf 100644
e4ffb1
--- a/tests/data/metadata/fence_ilo3_ssh.xml
e4ffb1
+++ b/tests/data/metadata/fence_ilo3_ssh.xml
e4ffb1
@@ -10,12 +10,12 @@
e4ffb1
 		<content type="string" default="23"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_ilo4.xml b/tests/data/metadata/fence_ilo4.xml
e4ffb1
index 4f29073..b7dd31a 100644
e4ffb1
--- a/tests/data/metadata/fence_ilo4.xml
e4ffb1
+++ b/tests/data/metadata/fence_ilo4.xml
e4ffb1
@@ -12,7 +12,7 @@
e4ffb1
 		<content type="string" default="623"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
@@ -22,7 +22,7 @@
e4ffb1
 		<content type="boolean"  />
e4ffb1
 		<shortdesc lang="en">Forces agent to use IPv6 addresses only</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_ilo4_ssh.xml b/tests/data/metadata/fence_ilo4_ssh.xml
e4ffb1
index 197d627..4ca2397 100644
e4ffb1
--- a/tests/data/metadata/fence_ilo4_ssh.xml
e4ffb1
+++ b/tests/data/metadata/fence_ilo4_ssh.xml
e4ffb1
@@ -10,12 +10,12 @@
e4ffb1
 		<content type="string" default="23"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_ilo_mp.xml b/tests/data/metadata/fence_ilo_mp.xml
e4ffb1
index d2396e9..14fc3c8 100644
e4ffb1
--- a/tests/data/metadata/fence_ilo_mp.xml
e4ffb1
+++ b/tests/data/metadata/fence_ilo_mp.xml
e4ffb1
@@ -8,12 +8,12 @@
e4ffb1
 		<content type="string" default="23"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_ilo_ssh.xml b/tests/data/metadata/fence_ilo_ssh.xml
e4ffb1
index 1d79308..4448d2d 100644
e4ffb1
--- a/tests/data/metadata/fence_ilo_ssh.xml
e4ffb1
+++ b/tests/data/metadata/fence_ilo_ssh.xml
e4ffb1
@@ -10,12 +10,12 @@
e4ffb1
 		<content type="string" default="23"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_imm.xml b/tests/data/metadata/fence_imm.xml
e4ffb1
index 0302f84..0e7588d 100644
e4ffb1
--- a/tests/data/metadata/fence_imm.xml
e4ffb1
+++ b/tests/data/metadata/fence_imm.xml
e4ffb1
@@ -12,7 +12,7 @@
e4ffb1
 		<content type="string" default="623"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
@@ -22,7 +22,7 @@
e4ffb1
 		<content type="boolean"  />
e4ffb1
 		<shortdesc lang="en">Forces agent to use IPv6 addresses only</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_ipmilan.xml b/tests/data/metadata/fence_ipmilan.xml
e4ffb1
index 4ed67eb..443365c 100644
e4ffb1
--- a/tests/data/metadata/fence_ipmilan.xml
e4ffb1
+++ b/tests/data/metadata/fence_ipmilan.xml
e4ffb1
@@ -12,7 +12,7 @@
e4ffb1
 		<content type="string" default="623"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
@@ -22,7 +22,7 @@
e4ffb1
 		<content type="boolean"  />
e4ffb1
 		<shortdesc lang="en">Forces agent to use IPv6 addresses only</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_mpath.xml b/tests/data/metadata/fence_mpath.xml
e4ffb1
index d3de9d5..c578f7a 100644
e4ffb1
--- a/tests/data/metadata/fence_mpath.xml
e4ffb1
+++ b/tests/data/metadata/fence_mpath.xml
e4ffb1
@@ -4,25 +4,20 @@
e4ffb1
 The fence_mpath agent works by having an unique key for each pair of node and device that has to be set also in /etc/multipath.conf. Once registered, a single node will become the reservation holder by creating a "write exclusive, registrants only" reservation on the device(s). The result is that only registered nodes may write to the device(s). When a node failure occurs, the fence_mpath agent will remove the key belonging to the failed node from the device(s). The failed node will no longer be able to write to the device(s). A manual reboot is required.</longdesc>
e4ffb1
 <vendor-url>https://www.sourceware.org/dm/</vendor-url>
e4ffb1
 <parameters>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
-		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
+	<parameter name="devices" unique="0" required="0">
e4ffb1
+		<getopt mixed="-d, --devices=[devices]" />
e4ffb1
 		<content type="string"  />
e4ffb1
-		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
-	</parameter>
e4ffb1
-	<parameter name="action" unique="0" required="1">
e4ffb1
-		<getopt mixed="-o, --action=[action]" />
e4ffb1
-		<content type="string" default="off"  />
e4ffb1
-		<shortdesc lang="en">Fencing Action</shortdesc>
e4ffb1
+		<shortdesc lang="en">List of devices to use for current operation. Devices can be comma-separated list of device-mapper multipath devices (eg. /dev/dm-3). Each device must support SCSI-3 persistent reservations.</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
 	<parameter name="key" unique="0" required="1">
e4ffb1
 		<getopt mixed="-k, --key=[key]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">Key to use for the current operation. This key should be unique to a node and have to be written in /etc/multipath.conf. For the "on" action, the key specifies the key use to register the local node. For the "off" action, this key specifies the key to be removed from the device(s).</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="devices" unique="0" required="0">
e4ffb1
-		<getopt mixed="-d, --devices=[devices]" />
e4ffb1
-		<content type="string"  />
e4ffb1
-		<shortdesc lang="en">List of devices to use for current operation. Devices can be comma-separated list of device-mapper multipath devices (eg. /dev/dm-3). Each device must support SCSI-3 persistent reservations.</shortdesc>
e4ffb1
+	<parameter name="action" unique="0" required="1">
e4ffb1
+		<getopt mixed="-o, --action=[action]" />
e4ffb1
+		<content type="string" default="off"  />
e4ffb1
+		<shortdesc lang="en">Fencing Action</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
 	<parameter name="verbose" unique="0" required="0">
e4ffb1
 		<getopt mixed="-v, --verbose" />
e4ffb1
@@ -44,31 +39,11 @@ The fence_mpath agent works by having an unique key for each pair of node and de
e4ffb1
 		<content type="boolean"  />
e4ffb1
 		<shortdesc lang="en">Display help and exit</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="power_wait" unique="0" required="0">
e4ffb1
-		<getopt mixed="--power-wait=[seconds]" />
e4ffb1
-		<content type="string" default="0"  />
e4ffb1
-		<shortdesc lang="en">Wait X seconds after issuing ON/OFF</shortdesc>
e4ffb1
-	</parameter>
e4ffb1
-	<parameter name="login_timeout" unique="0" required="0">
e4ffb1
-		<getopt mixed="--login-timeout=[seconds]" />
e4ffb1
-		<content type="string" default="5"  />
e4ffb1
-		<shortdesc lang="en">Wait X seconds for cmd prompt after login</shortdesc>
e4ffb1
-	</parameter>
e4ffb1
-	<parameter name="port_as_ip" unique="0" required="0">
e4ffb1
-		<getopt mixed="--port-as-ip" />
e4ffb1
-		<content type="boolean"  />
e4ffb1
-		<shortdesc lang="en">Make "port/plug" to be an alias to IP address</shortdesc>
e4ffb1
-	</parameter>
e4ffb1
 	<parameter name="delay" unique="0" required="0">
e4ffb1
 		<getopt mixed="--delay=[seconds]" />
e4ffb1
 		<content type="string" default="0"  />
e4ffb1
 		<shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="mpathpersist_path" unique="0" required="0">
e4ffb1
-		<getopt mixed="--mpathpersist-path=[path]" />
e4ffb1
-		<content type="string" default="/usr/sbin/mpathpersist"  />
e4ffb1
-		<shortdesc lang="en">Path to mpathpersist binary</shortdesc>
e4ffb1
-	</parameter>
e4ffb1
 	<parameter name="shell_timeout" unique="0" required="0">
e4ffb1
 		<getopt mixed="--shell-timeout=[seconds]" />
e4ffb1
 		<content type="string" default="3"  />
e4ffb1
@@ -84,6 +59,21 @@ The fence_mpath agent works by having an unique key for each pair of node and de
e4ffb1
 		<content type="string" default="20"  />
e4ffb1
 		<shortdesc lang="en">Test X seconds for status change after ON/OFF</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
+	<parameter name="power_wait" unique="0" required="0">
e4ffb1
+		<getopt mixed="--power-wait=[seconds]" />
e4ffb1
+		<content type="string" default="0"  />
e4ffb1
+		<shortdesc lang="en">Wait X seconds after issuing ON/OFF</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="login_timeout" unique="0" required="0">
e4ffb1
+		<getopt mixed="--login-timeout=[seconds]" />
e4ffb1
+		<content type="string" default="5"  />
e4ffb1
+		<shortdesc lang="en">Wait X seconds for cmd prompt after login</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="mpathpersist_path" unique="0" required="0">
e4ffb1
+		<getopt mixed="--mpathpersist-path=[path]" />
e4ffb1
+		<content type="string" default="/usr/sbin/mpathpersist"  />
e4ffb1
+		<shortdesc lang="en">Path to mpathpersist binary</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
 	<parameter name="retry_on" unique="0" required="0">
e4ffb1
 		<getopt mixed="--retry-on=[attempts]" />
e4ffb1
 		<content type="string" default="1"  />
e4ffb1
diff --git a/tests/data/metadata/fence_rsa.xml b/tests/data/metadata/fence_rsa.xml
e4ffb1
index 3f3a336..2981f04 100644
e4ffb1
--- a/tests/data/metadata/fence_rsa.xml
e4ffb1
+++ b/tests/data/metadata/fence_rsa.xml
e4ffb1
@@ -8,12 +8,12 @@
e4ffb1
 		<content type="string" default="23"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
diff --git a/tests/data/metadata/fence_rsb.xml b/tests/data/metadata/fence_rsb.xml
e4ffb1
index 36b9cdb..c27ebe4 100644
e4ffb1
--- a/tests/data/metadata/fence_rsb.xml
e4ffb1
+++ b/tests/data/metadata/fence_rsb.xml
e4ffb1
@@ -8,12 +8,12 @@
e4ffb1
 		<content type="string" default="3172"  />
e4ffb1
 		<shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="ipaddr" unique="0" required="1">
e4ffb1
+	<parameter name="ipaddr" unique="0" required="0">
e4ffb1
 		<getopt mixed="-a, --ip=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP Address or Hostname</shortdesc>
e4ffb1
 	</parameter>
e4ffb1
-	<parameter name="port" unique="0" required="1">
e4ffb1
+	<parameter name="port" unique="0" required="0">
e4ffb1
 		<getopt mixed="-n, --plug=[ip]" />
e4ffb1
 		<content type="string"  />
e4ffb1
 		<shortdesc lang="en">IP address or hostname of fencing device (together with --port-as-ip)</shortdesc>
e4ffb1
-- 
e4ffb1
1.9.3
e4ffb1