1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# -*- coding: UTF-8 -*-
# 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>"
from ....utils_cib import ResourceSpec, rg2hb_xsl
ccsflat2pcsprelude = '''\
<!--
apache ~ apache
-->
<xsl:when test="name() = 'apache'">
''' + (
ResourceSpec('ocf:heartbeat:apache').xsl_attrs
) + '''
<!-- INSTANCE_ATTRIBUTES -->
<instance_attributes id="{concat($Prefix, '-ATTRS')}">
''' + (
rg2hb_xsl('configfile', 'config_file')
) + '''\
<!-- options ~ httpd_options (if present; + name, server_root) -->
<nvpair id="{concat($Prefix, '-ATTRS-options')}"
name="options">
<xsl:attribute name="value">
<xsl:value-of select="concat(
' -D', @name
)"/>
<xsl:if test="@server_root">
<xsl:value-of select="concat(
' -d "', @server_root, '"'
)"/>
</xsl:if>
<xsl:if test="@httpd_options">
<xsl:value-of select="concat(
' ', @httpd_options
)"/>
</xsl:if>
</xsl:attribute>
</nvpair>
''' + (
# see rhbz#952132
rg2hb_xsl('httpd', 'httpd')
) + '''\
</instance_attributes>
<!-- OPERATIONS -->
<operations>
''' + (
rg2hb_xsl('stop', 'shutdown_wait', op=True)
) + '''\
</operations>
</xsl:when>
'''
###
from ....filters.ccs_artefacts import artefact_cond_ra
ccs_artefacts = ''.join((
artefact_cond_ra('@httpd',
kind='B', desc='path to httpd binary'),
artefact_cond_ra('@server_root',
kind='D', desc='ServerRoot'),
artefact_cond_ra('@config_file[../@server_root]',
xpath="concat(../@server_root, '/', .)",
kind='A', desc='configuration file'),
))
|