diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2015-03-12 23:47:07 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2015-03-16 22:40:50 +0100 |
commit | b68df377eff049912edda0bdc8264a883541b693 (patch) | |
tree | 60d78d62acd365ed8b31c5ec58f53488d9c9b96a | |
parent | c9797a58c3e4f7b120d90e5375f768f9a80980de (diff) | |
download | clufter-b68df377eff049912edda0bdc8264a883541b693.tar.gz clufter-b68df377eff049912edda0bdc8264a883541b693.tar.xz clufter-b68df377eff049912edda0bdc8264a883541b693.zip |
filters/ccsflat2pcsprelude[tomcat-6]: enable pseudo-conversion
Problem is in "params in system-wide sysconfig file" (rgmanager RA) vs.
"params properly tracked as cluster config" (heartbeat RA).
Could be extended to actually read the referred file, but that is quite
unreliable (existence of that file cannot be assumed in various
scenarios).
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1201317
Reported-by: Patrik Hagara <phagara@redhat.com>
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r-- | filters/cluster/rm/tomcat-6/__init__.py | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/filters/cluster/rm/tomcat-6/__init__.py b/filters/cluster/rm/tomcat-6/__init__.py index fa41109..3b26ace 100644 --- a/filters/cluster/rm/tomcat-6/__init__.py +++ b/filters/cluster/rm/tomcat-6/__init__.py @@ -1,5 +1,5 @@ # -*- coding: UTF-8 -*- -# Copyright 2014 Red Hat, Inc. +# Copyright 2015 Red Hat, Inc. # Part of clufter project # Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt) __author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>" @@ -10,3 +10,70 @@ ccs_artefacts = ''.join(( artefact_cond_ra('@config_file', kind='A', desc='configuration file'), )) + +### + +from ....utils_cib import ResourceSpec, rg2hb_xsl +from ....utils_xml import squote + +ccsflat2pcsprelude = ('''\ + <!-- + tomcat ~ tomcat-6 + --> + <xsl:when test="name() = 'tomcat-6'"> +''' + ( + ResourceSpec('ocf:heartbeat:tomcat').xsl_attrs +) + ''' + <xsl:comment><xsl:value-of select="concat(' ', %(note)s, ' ')"/></xsl:comment> + <xsl:message><xsl:value-of select="concat(%(note)s)"/></xsl:message> + + <!-- INSTANCE_ATTRIBUTES --> + <instance_attributes id="{concat($Prefix, '-ATTRS')}"> + <xsl:choose> + <!-- NOTE we rely on atmost single dot separator + in the version, hence conformity with IEEE 754 --> + <xsl:when test="$system = 'linux' and ( + $system_1 = 'fedora' and $system_2 >= 20 + )"> +''' + ( + rg2hb_xsl('java_home', '/usr/lib/jvm/jre-1.8.0', req=abs) + + + rg2hb_xsl('catalina_home', '/usr/share/tomcat', req=abs) +) + '''\ + </xsl:when> + <xsl:when test="$system = 'linux' and ( + $system_1 = 'redhat' and $system_2 >= 7 + or + $system_1 = 'fedora' and $system_2 >= 17 + )"> +''' + ( + rg2hb_xsl('java_home', '/usr/lib/jvm/jre-1.7.0', req=abs) + + + rg2hb_xsl('catalina_home', '/usr/share/tomcat', req=abs) +) + '''\ + </xsl:when> + <xsl:otherwise> +''' + ( + # especially RHEL 6 + rg2hb_xsl('java_home', '/usr/lib/jvm/jre-1.5.0', req=abs) + + + rg2hb_xsl('catalina_home', '/usr/share/tomcat6', req=abs) +) + '''\ + </xsl:otherwise> + </instance_attributes> + + <!-- OPERATIONS --> + <operations> +''' + ( + rg2hb_xsl('stop', 'shutdown_wait', op=True) +) + '''\ + </operations> + </xsl:when> +''') % dict( + note=', '.join(( + squote("NOTE: cannot convert directly, prefilling defaults; "), + squote("consider manual completion based on /etc/tomcat6/tomcat6.conf ("), + "@config_file", + squote(") file (or switching to LSB/systemd)") + )) +) |