Skip to content

Commit 4dcac18

Browse files
authored
Minor changes (#1437)
Include: - Dev: Remove unused code about hb_delnode - Dev: crash_test.utils: Reuse color constants from crmsh.constants - Dev: ui_configure: Remove _keywords interface and unused code
2 parents 4a694b7 + 427d4f3 commit 4dcac18

File tree

8 files changed

+5
-89
lines changed

8 files changed

+5
-89
lines changed

crmsh/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ def get(self, value):
269269
'crm_dtd_dir': opt_dir('%(datadir)s/pacemaker'),
270270
'pe_state_dir': opt_dir('%(varlib)s/pacemaker/pengine'),
271271
'heartbeat_dir': opt_dir('%(varlib)s/heartbeat'),
272-
'hb_delnode': opt_program('', ('%(datadir)s/heartbeat/hb_delnode',)),
273272
'hawk_wizards': opt_dir('%(wwwdir)s/hawk/config/wizard'),
274273
},
275274
'color': {

crmsh/constants.py

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -4,80 +4,6 @@
44
from .ordereddict import odict
55

66

7-
# A list of all keywords introduced in the
8-
# CIB language.
9-
keywords = {
10-
"node": "element",
11-
"primitive": "element",
12-
"resource": "element",
13-
"group": "element",
14-
"bundle": "element",
15-
"clone": "element",
16-
"ms": "element",
17-
"master": "element",
18-
"location": "element",
19-
"colocation": "element",
20-
"collocation": "element",
21-
"order": "element",
22-
"rsc_ticket": "element",
23-
"rsc_template": "element",
24-
"property": "element",
25-
"rsc_defaults": "element",
26-
"op_defaults": "element",
27-
"acl_target": "element",
28-
"acl_group": "element",
29-
"user": "element",
30-
"role": "element",
31-
"fencing_topology": "element",
32-
"fencing-topology": "element",
33-
"tag": "element",
34-
"alert": "element",
35-
"monitor": "element",
36-
"params": "subelement",
37-
"meta": "subelement",
38-
"attributes": "subelement",
39-
"utilization": "subelement",
40-
"operations": "subelement",
41-
"op": "subelement",
42-
"rule": "subelement",
43-
"to": "subelement",
44-
"inf": "value",
45-
"INFINITY": "value",
46-
"and": "op",
47-
"or": "op",
48-
"lt": "op",
49-
"gt": "op",
50-
"lte": "op",
51-
"gte": "op",
52-
"eq": "op",
53-
"ne": "op",
54-
"defined": "op",
55-
"not_defined": "op",
56-
"in_range": "op",
57-
"in": "op",
58-
"date_spec": "op",
59-
"spec": "op",
60-
"date": "value",
61-
"yes": "value",
62-
"no": "value",
63-
"true": "value",
64-
"false": "value",
65-
"on": "value",
66-
"off": "value",
67-
"normal": "value",
68-
"member": "value",
69-
"ping": "value",
70-
"remote": "value",
71-
"start": "value",
72-
"stop": "value",
73-
"Mandatory": "value",
74-
"Optional": "value",
75-
"Serialize": "value",
76-
"ref": "value",
77-
"xpath": "value",
78-
"xml": "element",
79-
}
80-
817
cib_cli_map = {
828
"node": "node",
839
"primitive": "primitive",

crmsh/crash_test/utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
from . import config
1010
from crmsh import log
1111
from crmsh.sh import ShellUtils
12+
from crmsh import constants
1213

1314

1415
logger = log.setup_logger(__name__)
1516

1617

17-
CRED = '\033[31m'
18-
CYELLOW = '\033[33m'
19-
CGREEN = '\033[32m'
20-
CEND = '\033[0m'
18+
CRED = constants.RED
19+
CYELLOW = constants.YELLOW
20+
CGREEN = constants.GREEN
21+
CEND = constants.END
2122

2223
LEVEL = {
2324
"info": logging.INFO,

crmsh/ui_configure.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,12 +540,6 @@ def do_regression_testing(self, context, param):
540540
def do_showobjects(self, context):
541541
cib_factory.showobjects()
542542

543-
@command.name('_keywords')
544-
@command.skill_level('administrator')
545-
def do_keywords(self, context):
546-
for k, v in sorted(iter(constants.keywords.items()), key=lambda v: v[0].lower()):
547-
print("%-16s %s" % (k, v))
548-
549543
@command.level(ui_ra.RA)
550544
def do_ra(self):
551545
pass

crmsh/ui_node.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ class NodeMgmt(command.UI):
287287
shutdown="0"
288288
/>'""")
289289
node_clear_state_118 = "stonith_admin --confirm %s"
290-
hb_delnode = config.path.hb_delnode + " '%s'"
291290
crm_node = "crm_node"
292291
node_fence = "crm_attribute -t status -N '%s' -n terminate -v true"
293292
dc = "crmadmin -D"

doc/website-v1/configuration.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ ocf_root = /usr/lib/ocf
7272
crm_dtd_dir = /usr/share/pacemaker
7373
pe_state_dir = /var/lib/pacemaker/pengine
7474
heartbeat_dir = /var/lib/heartbeat
75-
hb_delnode = /usr/share/heartbeat/hb_delnode
7675
7776
[color]
7877
style = color

etc/crm.conf.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ ocf_root = @OCF_ROOT_DIR@
5050
; crm_dtd_dir = <detected>
5151
; pe_state_dir = <detected>
5252
; heartbeat_dir = <detected>
53-
; hb_delnode = /usr/share/heartbeat/hb_delnode
5453

5554
; [color]
5655
; style = color

test/unittests/test.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ ocf_root = .
88
crm_dtd_dir = .
99
pe_state_dir = .
1010
heartbeat_dir = .
11-
hb_delnode = ./hb_delnode

0 commit comments

Comments
 (0)