Skip to content

Commit

Permalink
Dev: Remove 'ms' and 'master' terminology from crmsh
Browse files Browse the repository at this point in the history
  • Loading branch information
liangxin1300 committed Jan 12, 2025
1 parent 7bb1ff9 commit df6279f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 24 deletions.
3 changes: 0 additions & 3 deletions crmsh/cibconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -1704,8 +1704,6 @@ def check_sanity(self):
l = get_resource_meta_list()
if self.obj_type == "clone":
l += constants.clone_meta_attributes
elif self.obj_type == "ms":
l += constants.clone_meta_attributes + constants.ms_meta_attributes
elif self.obj_type == "group":
l += constants.group_meta_attributes
rc = sanity_check_meta(self.obj_id, self.node, l)
Expand Down Expand Up @@ -2283,7 +2281,6 @@ def get_default_timeout():
"primitive": ("primitive", CibPrimitive, "resources"),
"group": ("group", CibContainer, "resources"),
"clone": ("clone", CibContainer, "resources"),
"master": ("ms", CibContainer, "resources"),
"template": ("rsc_template", CibPrimitive, "resources"),
"bundle": ("bundle", CibBundle, "resources"),
"rsc_location": ("location", CibLocation, "constraints"),
Expand Down
12 changes: 2 additions & 10 deletions crmsh/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"primitive": "primitive",
"group": "group",
"clone": "clone",
"master": "ms",
"bundle": "bundle",
"rsc_location": "location",
"rsc_colocation": "colocation",
Expand All @@ -23,7 +22,7 @@
"tag": "tag",
"alert": "alert",
}
container_tags = ("group", "clone", "ms", "master", "bundle")
container_tags = ("group", "clone", "bundle")
clonems_tags = ("clone", "ms", "master")
resource_tags = ("primitive", "group", "clone", "ms", "master", "template", "bundle")
constraint_tags = ("rsc_location", "rsc_colocation", "rsc_order", "rsc_ticket")
Expand Down Expand Up @@ -144,10 +143,6 @@
"clone-max", "clone-node-max", "clone-state", "description",
"clone-min", "promotable", "promoted-max", "promoted-node-max",
)
ms_meta_attributes = common_meta_attributes + (
"clone-max", "clone-node-max", "notify", "globally-unique", "ordered",
"interleave", "master-max", "master-node-max", "description",
)
bundle_meta_attributes = common_meta_attributes
alert_meta_attributes = (
"timeout", "timestamp-format"
Expand Down Expand Up @@ -219,9 +214,6 @@
"clone": {
"color": "#ec008c",
},
"ms": {
"color": "#f8981d",
},
"bundle": {
"color": "#00aeef",
"style": "rounded",
Expand Down Expand Up @@ -447,7 +439,7 @@
DLM_PORT = 21064

# Commands that are deprecated and hidden from UI
HIDDEN_COMMANDS = {'ms'}
HIDDEN_COMMANDS = {}

NO_SSH_ERROR_MSG = "ssh-related operations are disabled. crmsh works in local mode."

Expand Down
10 changes: 2 additions & 8 deletions crmsh/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ def parse_node(self, cmd):
return out


@parser_for('primitive', 'group', 'clone', 'ms', 'master', 'rsc_template', 'bundle')
@parser_for('primitive', 'group', 'clone', 'rsc_template', 'bundle')
class ResourceParser(BaseParser):
def match_ra_type(self, out):
"[<class>:[<provider>:]]<type>"
Expand Down Expand Up @@ -936,11 +936,9 @@ def _primitive_or_template(self):
parse_primitive = _primitive_or_template
parse_rsc_template = _primitive_or_template

def _master_or_clone(self):
def parse_clone(self):
if self.matched(0).lower() == 'clone':
out = xmlutil.new('clone')
else:
out = xmlutil.new('master')
out.set('id', self.match_identifier())

child = xmlutil.new('crmsh-ref', id=self.match_resource())
Expand All @@ -950,10 +948,6 @@ def _master_or_clone(self):
out.append(child)
return out

parse_master = _master_or_clone
parse_ms = _master_or_clone
parse_clone = _master_or_clone

def _try_group_resource(self):
t = self.current_token()
if (not t) or ('=' in t) or (t.lower() in ('params', 'meta')):
Expand Down
2 changes: 0 additions & 2 deletions crmsh/ui_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ def _advanced_completer(args):
return_list = utils.filter_keys(constants.group_meta_attributes, args)
if resource_type == "clone":
return_list = utils.filter_keys(constants.clone_meta_attributes, args)
if resource_type in ["ms", "master"]:
return_list = utils.filter_keys(constants.ms_meta_attributes, args)
return return_list + key_words


Expand Down
2 changes: 1 addition & 1 deletion crmsh/xmlutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ def make_sort_map(*order):

_sort_cli_order = make_sort_map('node',
'rsc_template', 'primitive', 'bundle', 'group',
['ms', 'master'], 'clone', 'op',
'clone', 'op',
'tag',
['location', 'colocation', 'collocation', 'order'],
['rsc_ticket', 'fencing_topology'],
Expand Down

0 comments on commit df6279f

Please sign in to comment.