File: vars.py.in

package info (click to toggle)
pacemaker 1.0.9.1%2Bhg15626-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 34,668 kB
  • ctags: 5,645
  • sloc: xml: 87,444; ansic: 57,853; python: 11,479; sh: 5,255; makefile: 663; perl: 387; sed: 262
file content (133 lines) | stat: -rw-r--r-- 4,995 bytes parent folder | download
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Copyright (C) 2008 Dejan Muhamedagic <dmuhamedagic@suse.de>
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# 
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
# 
# You should have received a copy of the GNU General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

import os
from singletonmixin import Singleton

class Vars(Singleton):
    cib_cli_map = {
    "node": "node",
    "primitive": "primitive",
    "group": "group",
    "clone": "clone",
    "master": "ms",
    "rsc_location": "location",
    "rsc_colocation": "colocation",
    "rsc_order": "order",
    "cluster_property_set": "property",
    "rsc_defaults": "rsc_defaults",
    "op_defaults": "op_defaults",
    }
    container_tags = ("group", "clone", "ms", "master")
    clonems_tags = ("clone", "ms", "master")
    resource_tags = ("primitive","group","clone","ms","master")
    constraint_tags = ("rsc_location","rsc_colocation","rsc_order")
    constraint_rsc_refs = ("rsc","with-rsc","first","then")
    children_tags = ("group", "primitive")
    nvpairs_tags = ("meta_attributes", "instance_attributes")
    defaults_tags = ("rsc_defaults","op_defaults")
    resource_cli_names = ("primitive","group","clone","ms","master")
    constraint_cli_names = ("location","colocation","collocation","order")
    nvset_cli_names = ("property","rsc_defaults","op_defaults")
    op_cli_names = ("monitor", "start", "stop", "migrate_to", "migrate_from","promote","demote","notify")
    ra_operations = ("probe", "monitor", "start", "stop",
       "promote", "demote", "notify", "migrate_to", "migrate_from")
    subpfx_list = {
        "instance_attributes": "instance_attributes",
        "meta_attributes": "meta_attributes",
        "operations": "ops",
        "rule": "rule",
        "expression": "expression",
        "date_expression": "expression",
        "duration": "duration",
        "date_spec": "date_spec",
    }
    lrm_exit_codes = {
        "success": "0",
        "unknown": "1",
        "args": "2",
        "unimplemented": "3",
        "perm": "4",
        "installed": "5",
        "configured": "6",
        "not_running": "7",
        "master": "8",
        "failed_master": "9",
    }
    lrm_status_codes = {
        "pending": "-1",
        "done": "0",
        "cancelled": "1",
        "timeout": "2",
        "notsupported": "3",
        "error": "4",
    }
    node_states = ("online", "offline", "unclean")
    precious_attrs = ("id-ref",)
    time_op_attrs = ("timeout",)
    req_op_attributes = ("name", "id")
    op_attributes = (
        "interval", "timeout", "requires", "enabled", "role",
        "on-fail", "start-delay", "interval-origin",
        "record-pending", "description",
    )
    rsc_meta_attributes = (
        "allow-migrate", "is-managed", "interval-origin",
        "migration-threshold", "priority", "multiple-active",
        "failure-timeout", "resource-stickiness", "target-role",
        "restart-type", "description",
    )
    clone_meta_attributes = (
        "ordered", "notify", "interleave", "globally-unique",
        "clone-max", "clone-node-max", "clone-state", "description",
    )
    ms_meta_attributes = (
        "master-max", "master-node-max", "description",
    )
    score_types = {'advisory': '0','mandatory': 'INFINITY'}
    boolean_ops = ('or','and')
    binary_ops = ('lt','gt','lte','gte','eq','ne')
    binary_types = ('string' , 'version' , 'number')
    unary_ops = ('defined','not_defined')
    simple_date_ops = ('lt','gt')
    date_ops = ('lt','gt','in_range','date_spec')
    date_spec_names = '''hours monthdays weekdays yearsdays months \
        weeks years weekyears moon'''.split()
    in_range_attrs = ('start','end')
    roles_names = ('Stopped', 'Started', 'Master', 'Slave')
    actions_names = ( 'start', 'promote', 'demote', 'stop')
    node_default_type = "normal"
    node_attributes_keyw = ("attributes",)
    shadow_envvar = "CIB_shadow"

    prompt = ''
    tmpfiles = []
    this_node = os.uname()[1]
    cib_in_use = os.getenv(shadow_envvar)
    hist_file = os.environ.get('HOME')+"/.crm_history"
    rc_file = os.environ.get('HOME')+"/.crm.rc"
    tmpl_conf_dir = "%s/%s" % (os.getenv("HOME"),".crmconf")
    tmpl_dir = "@datadir@/@PACKAGE@/templates"
    pe_dir = "@PE_STATE_DIR@"
    crm_conf_dir = "@CRM_CONFIG_DIR@"

    ra_if = None # class interface to RA
    stonithd_metadata = None # stonithd meta data
    pe_metadata = None # PE meta data
    crmd_metadata = None # crmd meta data

# vim:ts=4:sw=4:et: