summaryrefslogtreecommitdiffstats
path: root/filters/cluster/rm/lvm/__init__.py
blob: d27e4650e6a2512c3cecbd34b1de2a28c8356941 (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
32
33
# -*- 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 = '''\
    <!--
        LVM ~ lvm
     -->
    <xsl:when test="name() = 'lvm'">
''' + (
        ResourceSpec('ocf:heartbeat:LVM').xsl_attrs
) + '''
        <!-- SHOW-STOPPERS -->
        <xsl:if test="@lv_name">
            <xsl:message terminate="true"
            >Cannot convert LV binding, stick with whole VG one</xsl:message>
        </xsl:if>

        <!-- INSTANCE_ATTRIBUTES -->
        <instance_attributes id="{concat($Prefix, '-ATTRS')}">
''' + (
            rg2hb_xsl('volgrpname', 'vg_name', required=True)
            +
            rg2hb_xsl('exclusive', 'true', required=abs)
) + '''\
        </instance_attributes>
    </xsl:when>
'''