From 3c4651ba655a7346f4e67335229b76ed24d1c917 Mon Sep 17 00:00:00 2001 From: Marek 'marx' Grac Date: Wed, 5 Aug 2015 15:29:12 +0200 Subject: [PATCH 3/4] fencing: Fix XML metadata and their creation for 'port_as_ip' --- fence/agents/dummy/fence_dummy.py | 1 + fence/agents/lib/fencing.py.py | 5 +++- tests/data/metadata/fence_alom.xml | 4 +-- tests/data/metadata/fence_amt.xml | 4 +-- tests/data/metadata/fence_drac.xml | 4 +-- tests/data/metadata/fence_dummy.xml | 10 ------- tests/data/metadata/fence_idrac.xml | 4 +-- tests/data/metadata/fence_ilo.xml | 4 +-- tests/data/metadata/fence_ilo2.xml | 4 +-- tests/data/metadata/fence_ilo3.xml | 4 +-- tests/data/metadata/fence_ilo3_ssh.xml | 4 +-- tests/data/metadata/fence_ilo4.xml | 4 +-- tests/data/metadata/fence_ilo4_ssh.xml | 4 +-- tests/data/metadata/fence_ilo_mp.xml | 4 +-- tests/data/metadata/fence_ilo_ssh.xml | 4 +-- tests/data/metadata/fence_imm.xml | 4 +-- tests/data/metadata/fence_ipmilan.xml | 4 +-- tests/data/metadata/fence_mpath.xml | 54 ++++++++++++++-------------------- tests/data/metadata/fence_rsa.xml | 4 +-- tests/data/metadata/fence_rsb.xml | 4 +-- 20 files changed, 59 insertions(+), 75 deletions(-) diff --git a/fence/agents/dummy/fence_dummy.py b/fence/agents/dummy/fence_dummy.py index 9c4c5f1..7d6bd06 100644 --- a/fence/agents/dummy/fence_dummy.py +++ b/fence/agents/dummy/fence_dummy.py @@ -115,6 +115,7 @@ def main(): if (pinput.has_key("--type") and pinput["--type"] == "file") or (pinput.has_key("--type") == False): # hack to have fence agents that require ports 'fail' and one that do not 'file' device_opt.remove("port") + device_opt.remove("separator") options = check_input(device_opt, process_input(device_opt)) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index f14d7e0..8b14cf2 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -463,7 +463,10 @@ def add_dependency_options(options): if DEPENDENCY_OPT.has_key(opt): added_opt.extend([y for y in DEPENDENCY_OPT[opt] if options.count(y) == 0]) - if not "port" in (options + added_opt) and not "nodename" in (options + added_opt): + if not "port" in (options + added_opt) and \ + not "nodename" in (options + added_opt) and \ + "ipaddr" in (options + added_opt): + added_opt.append("port_as_ip") all_opt["port"]["help"] = "-n, --plug=[ip] IP address or hostname of fencing device " \ "(together with --port-as-ip)" diff --git a/tests/data/metadata/fence_alom.xml b/tests/data/metadata/fence_alom.xml index dfbe431..f7e2f36 100644 --- a/tests/data/metadata/fence_alom.xml +++ b/tests/data/metadata/fence_alom.xml @@ -8,12 +8,12 @@ TCP/UDP port to use for connection with device - + IP Address or Hostname - + IP address or hostname of fencing device (together with --port-as-ip) diff --git a/tests/data/metadata/fence_amt.xml b/tests/data/metadata/fence_amt.xml index 17e38fc..61b39f5 100644 --- a/tests/data/metadata/fence_amt.xml +++ b/tests/data/metadata/fence_amt.xml @@ -8,7 +8,7 @@ TCP/UDP port to use for connection with device - + IP address or hostname of fencing device (together with --port-as-ip) @@ -18,7 +18,7 @@ Forces agent to use IPv6 addresses only - + IP Address or Hostname diff --git a/tests/data/metadata/fence_drac.xml b/tests/data/metadata/fence_drac.xml index 37697f7..1e94dbc 100644 --- a/tests/data/metadata/fence_drac.xml +++ b/tests/data/metadata/fence_drac.xml @@ -8,7 +8,7 @@ TCP/UDP port to use for connection with device - + IP address or hostname of fencing device (together with --port-as-ip) @@ -23,7 +23,7 @@ Forces agent to use IPv6 addresses only - + IP Address or Hostname diff --git a/tests/data/metadata/fence_dummy.xml b/tests/data/metadata/fence_dummy.xml index eb31244..07ad2cc 100644 --- a/tests/data/metadata/fence_dummy.xml +++ b/tests/data/metadata/fence_dummy.xml @@ -3,11 +3,6 @@ fence_dummy http://www.example.com - - - - IP address or hostname of fencing device (together with --port-as-ip) - @@ -63,11 +58,6 @@ Test X seconds for status change after ON/OFF - - - - Make "port/plug" to be an alias to IP address - diff --git a/tests/data/metadata/fence_idrac.xml b/tests/data/metadata/fence_idrac.xml index b742161..0aced2a 100644 --- a/tests/data/metadata/fence_idrac.xml +++ b/tests/data/metadata/fence_idrac.xml @@ -12,7 +12,7 @@ TCP/UDP port to use for connection with device - + IP address or hostname of fencing device (together with --port-as-ip) @@ -22,7 +22,7 @@ Forces agent to use IPv6 addresses only - + IP Address or Hostname diff --git a/tests/data/metadata/fence_ilo.xml b/tests/data/metadata/fence_ilo.xml index 891b7f1..2eead1e 100644 --- a/tests/data/metadata/fence_ilo.xml +++ b/tests/data/metadata/fence_ilo.xml @@ -34,12 +34,12 @@ Forces agent to use IPv6 addresses only - + IP Address or Hostname - + IP address or hostname of fencing device (together with --port-as-ip) diff --git a/tests/data/metadata/fence_ilo2.xml b/tests/data/metadata/fence_ilo2.xml index 7ff697f..3be62f1 100644 --- a/tests/data/metadata/fence_ilo2.xml +++ b/tests/data/metadata/fence_ilo2.xml @@ -34,12 +34,12 @@ Forces agent to use IPv6 addresses only - + IP Address or Hostname - + IP address or hostname of fencing device (together with --port-as-ip) diff --git a/tests/data/metadata/fence_ilo3.xml b/tests/data/metadata/fence_ilo3.xml index 05fd01c..67e869b 100644 --- a/tests/data/metadata/fence_ilo3.xml +++ b/tests/data/metadata/fence_ilo3.xml @@ -12,7 +12,7 @@ TCP/UDP port to use for connection with device - + IP address or hostname of fencing device (together with --port-as-ip) @@ -22,7 +22,7 @@ Forces agent to use IPv6 addresses only - + IP Address or Hostname diff --git a/tests/data/metadata/fence_ilo3_ssh.xml b/tests/data/metadata/fence_ilo3_ssh.xml index ebdae65..8268daf 100644 --- a/tests/data/metadata/fence_ilo3_ssh.xml +++ b/tests/data/metadata/fence_ilo3_ssh.xml @@ -10,12 +10,12 @@ TCP/UDP port to use for connection with device - + IP Address or Hostname - + IP address or hostname of fencing device (together with --port-as-ip) diff --git a/tests/data/metadata/fence_ilo4.xml b/tests/data/metadata/fence_ilo4.xml index 4f29073..b7dd31a 100644 --- a/tests/data/metadata/fence_ilo4.xml +++ b/tests/data/metadata/fence_ilo4.xml @@ -12,7 +12,7 @@ TCP/UDP port to use for connection with device - + IP address or hostname of fencing device (together with --port-as-ip) @@ -22,7 +22,7 @@ Forces agent to use IPv6 addresses only - + IP Address or Hostname diff --git a/tests/data/metadata/fence_ilo4_ssh.xml b/tests/data/metadata/fence_ilo4_ssh.xml index 197d627..4ca2397 100644 --- a/tests/data/metadata/fence_ilo4_ssh.xml +++ b/tests/data/metadata/fence_ilo4_ssh.xml @@ -10,12 +10,12 @@ TCP/UDP port to use for connection with device - + IP Address or Hostname - + IP address or hostname of fencing device (together with --port-as-ip) diff --git a/tests/data/metadata/fence_ilo_mp.xml b/tests/data/metadata/fence_ilo_mp.xml index d2396e9..14fc3c8 100644 --- a/tests/data/metadata/fence_ilo_mp.xml +++ b/tests/data/metadata/fence_ilo_mp.xml @@ -8,12 +8,12 @@ TCP/UDP port to use for connection with device - + IP Address or Hostname - + IP address or hostname of fencing device (together with --port-as-ip) diff --git a/tests/data/metadata/fence_ilo_ssh.xml b/tests/data/metadata/fence_ilo_ssh.xml index 1d79308..4448d2d 100644 --- a/tests/data/metadata/fence_ilo_ssh.xml +++ b/tests/data/metadata/fence_ilo_ssh.xml @@ -10,12 +10,12 @@ TCP/UDP port to use for connection with device - + IP Address or Hostname - + IP address or hostname of fencing device (together with --port-as-ip) diff --git a/tests/data/metadata/fence_imm.xml b/tests/data/metadata/fence_imm.xml index 0302f84..0e7588d 100644 --- a/tests/data/metadata/fence_imm.xml +++ b/tests/data/metadata/fence_imm.xml @@ -12,7 +12,7 @@ TCP/UDP port to use for connection with device - + IP address or hostname of fencing device (together with --port-as-ip) @@ -22,7 +22,7 @@ Forces agent to use IPv6 addresses only - + IP Address or Hostname diff --git a/tests/data/metadata/fence_ipmilan.xml b/tests/data/metadata/fence_ipmilan.xml index 4ed67eb..443365c 100644 --- a/tests/data/metadata/fence_ipmilan.xml +++ b/tests/data/metadata/fence_ipmilan.xml @@ -12,7 +12,7 @@ TCP/UDP port to use for connection with device - + IP address or hostname of fencing device (together with --port-as-ip) @@ -22,7 +22,7 @@ Forces agent to use IPv6 addresses only - + IP Address or Hostname diff --git a/tests/data/metadata/fence_mpath.xml b/tests/data/metadata/fence_mpath.xml index d3de9d5..c578f7a 100644 --- a/tests/data/metadata/fence_mpath.xml +++ b/tests/data/metadata/fence_mpath.xml @@ -4,25 +4,20 @@ 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. https://www.sourceware.org/dm/ - - + + - IP address or hostname of fencing device (together with --port-as-ip) - - - - - Fencing Action + 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. 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). - - - - 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. + + + + Fencing Action @@ -44,31 +39,11 @@ The fence_mpath agent works by having an unique key for each pair of node and de Display help and exit - - - - Wait X seconds after issuing ON/OFF - - - - - Wait X seconds for cmd prompt after login - - - - - Make "port/plug" to be an alias to IP address - Wait X seconds before fencing is started - - - - Path to mpathpersist binary - @@ -84,6 +59,21 @@ The fence_mpath agent works by having an unique key for each pair of node and de Test X seconds for status change after ON/OFF + + + + Wait X seconds after issuing ON/OFF + + + + + Wait X seconds for cmd prompt after login + + + + + Path to mpathpersist binary + diff --git a/tests/data/metadata/fence_rsa.xml b/tests/data/metadata/fence_rsa.xml index 3f3a336..2981f04 100644 --- a/tests/data/metadata/fence_rsa.xml +++ b/tests/data/metadata/fence_rsa.xml @@ -8,12 +8,12 @@ TCP/UDP port to use for connection with device - + IP Address or Hostname - + IP address or hostname of fencing device (together with --port-as-ip) diff --git a/tests/data/metadata/fence_rsb.xml b/tests/data/metadata/fence_rsb.xml index 36b9cdb..c27ebe4 100644 --- a/tests/data/metadata/fence_rsb.xml +++ b/tests/data/metadata/fence_rsb.xml @@ -8,12 +8,12 @@ TCP/UDP port to use for connection with device - + IP Address or Hostname - + IP address or hostname of fencing device (together with --port-as-ip) -- 1.9.3