summaryrefslogtreecommitdiff
path: root/reconfigure/configs/ctdb.py
blob: 491ac282299485923976d01eb93243427f46c4a2 (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
34
35
36
37
38
39
40
41
42
43
44
from reconfigure.configs.base import Reconfig
from reconfigure.parsers import IniFileParser
from reconfigure.parsers import SSVParser
from reconfigure.builders import BoundBuilder
from reconfigure.items.ctdb import CTDBData, NodesData, PublicAddressesData


class CTDBConfig (Reconfig):
    """
    ``CTDB main config``
    """
    def __init__(self, **kwargs):
        k = {
            'parser': IniFileParser(sectionless=True),
            'builder': BoundBuilder(CTDBData),
        }
        k.update(kwargs)
        Reconfig.__init__(self, **k)


class CTDBNodesConfig (Reconfig):
    """
    ``CTDB node list file``
    """
    def __init__(self, **kwargs):
        k = {
            'parser': SSVParser(),
            'builder': BoundBuilder(NodesData),
        }
        k.update(kwargs)
        Reconfig.__init__(self, **k)


class CTDBPublicAddressesConfig (Reconfig):
    """
    ``CTDB public address list file``
    """
    def __init__(self, **kwargs):
        k = {
            'parser': SSVParser(),
            'builder': BoundBuilder(PublicAddressesData),
        }
        k.update(kwargs)
        Reconfig.__init__(self, **k)