summaryrefslogtreecommitdiffstats
path: root/filters/cib/configuration/resources/group/__init__.py
blob: e7e4e3dff9c0b5d074960fcdfec5aa52e969b1fc (plain)
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
# -*- coding: UTF-8 -*-
# Copyright 2016 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 ....filters._2pcscmd import verbose_ec_test, verbose_inform
from ....filters.cib2pcscmd import attrset_xsl
from ....utils_xslt import NL

cib2pcscmd = ('''\
''' + (
    verbose_inform('"new group: ", @id')
) + '''
    <xsl:value-of select="concat($pcscmd_pcs, 'resource group add ', @id)"/>
    <xsl:for-each select="primitive">
        <xsl:value-of select="concat(' ', @id)"/>
    </xsl:for-each>
    <xsl:value-of select="'%(NL)s'"/>
''' + (
    verbose_ec_test
) + '''

    <!-- meta attrs -->
''' + (
    attrset_xsl("meta_attributes",
                cmd='$pcscmd_pcs, "resource meta ", @id',
                inform='"meta attributes for group: ", @id')
)) % dict(
    NL=NL,
)