summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2016-01-30 03:09:19 +0100
committerJan Pokorný <jpokorny@redhat.com>2016-02-01 23:54:46 +0100
commit5489fca91240809e216589eb7fec206300a297f5 (patch)
treeee8bb1ebbe555334053dadf89e7b1ff342b769a1
parent7e60b5858f50d7b016174454ede1feee4598f5d9 (diff)
downloadclufter-5489fca91240809e216589eb7fec206300a297f5.tar.gz
clufter-5489fca91240809e216589eb7fec206300a297f5.tar.xz
clufter-5489fca91240809e216589eb7fec206300a297f5.zip
filters/cib2pcscmd[resources]: drop op options "spam"
Also reflect the changes in the tests. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rwxr-xr-x__root__/run-check6
-rw-r--r--filters/cib/configuration/resources/__init__.py6
-rw-r--r--tests/filters/cib2pcscmd.py4
3 files changed, 9 insertions, 7 deletions
diff --git a/__root__/run-check b/__root__/run-check
index 81bc86f..9a5330c 100755
--- a/__root__/run-check
+++ b/__root__/run-check
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright 2015 Red Hat, Inc.
+# Copyright 2016 Red Hat, Inc.
# Part of clufter project
# Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt)
@@ -229,9 +229,7 @@ pcs -f tmp-cib.xml stonith create FENCEDEV-xvm fence_xvm \\
pcmk_host_map=rhel6-node1:rhel6-node1,rhel6-node2:rhel6-node2
pcs -f tmp-cib.xml \\
resource create RESOURCE-ip-192.168.0.128 ocf:heartbeat:IPaddr2 \\
- ip=192.168.0.128 \\
- op monitor id=RESOURCE-ip-192.168.0.128-OP-monitor name=monitor \\
- interval=20s
+ ip=192.168.0.128 op monitor interval=20s
pcs -f tmp-cib.xml \\
resource group add SERVICE-mm-GROUP RESOURCE-ip-192.168.0.128
pcs -f tmp-cib.xml \\
diff --git a/filters/cib/configuration/resources/__init__.py b/filters/cib/configuration/resources/__init__.py
index 09ab546..2122410 100644
--- a/filters/cib/configuration/resources/__init__.py
+++ b/filters/cib/configuration/resources/__init__.py
@@ -502,7 +502,11 @@ cib2pcscmd = ('''\
<xsl:value-of select="' op'"/>
<xsl:for-each select="operations/op">
<xsl:value-of select="concat(' ', @name)"/>
- <xsl:for-each select="@*">
+ <xsl:for-each select="@*[
+ name() != 'id'
+ and
+ name() != 'name'
+ ]">
<xsl:value-of select='concat(" &apos;",
name(), "=", .,
"&apos;")'/>
diff --git a/tests/filters/cib2pcscmd.py b/tests/filters/cib2pcscmd.py
index 2cd1321..d028804 100644
--- a/tests/filters/cib2pcscmd.py
+++ b/tests/filters/cib2pcscmd.py
@@ -1,5 +1,5 @@
# -*- coding: UTF-8 -*-
-# Copyright 2015 Red Hat, Inc.
+# Copyright 2016 Red Hat, Inc.
# Part of clufter project
# Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt)
"""Testing `cib2pcscmd' filter"""
@@ -30,7 +30,7 @@ pcs stonith create FENCEDEV-fence-virt-064 fence_xvm 'auth=sha256' 'hash=sha256'
pcs stonith create FENCEDEV-fence-virt-069 fence_xvm 'auth=sha256' 'hash=sha256' 'key_file=/etc/cluster/fence_xvm.key' 'timeout=5' 'pcmk_host_map=virt-069:virt-069.cluster-qe.lab.eng.brq.redhat.com'
pcs resource create RESOURCE-ip-10.34.71.234 ocf:heartbeat:IPaddr2 'ip=10.34.71.234'
pcs resource create RESOURCE-apache-webserver ocf:heartbeat:apache 'configfile=/etc/httpd/sconf/httpd.conf' 'options= -Dwebserver -d "/etc/httpd"'
-pcs resource create memcached systemd:memcached op start 'id=memcached-start-timeout-60s' 'interval=0s' 'name=start' 'timeout=60s' monitor 'id=memcached-monitor-interval-60s' 'interval=60s' 'name=monitor'
+pcs resource create memcached systemd:memcached op start 'interval=0s' 'timeout=60s' monitor 'interval=60s'
pcs resource group add SERVICE-svc-GROUP RESOURCE-ip-10.34.71.234 RESOURCE-apache-webserver
pcs resource clone memcached 'interleave=true'
'''