Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[crmsh-4.6] Drop deprecated codes #1725

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crmsh/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@
date_spec_names = '''hours monthdays weekdays yearsdays months \
weeks years weekyears moon'''.split()
in_range_attrs = ('start', 'end')
node_default_type = "normal"
node_default_type = "member"
node_attributes_keyw = ("attributes", "utilization")
shadow_envvar = "CIB_shadow"
attr_defaults = {
"node": {"type": "normal"},
"node": {"type": "member"},
"resource_set": {"sequential": "true", "require-all": "true"},
"rule": {"boolean-op": "and"},
}
Expand Down
4 changes: 2 additions & 2 deletions crmsh/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
_ACL_RIGHT_RE = re.compile(r'(%s)$' % ('|'.join(constants.acl_rule_names)), re.IGNORECASE)
_ROLE_REF_RE = re.compile(r'role:(.+)$', re.IGNORECASE)
_PERM_RE = re.compile(r"([^:]+)(?::(.+))?$", re.I)
_UNAME_RE = re.compile(r'([^:]+)(:(normal|member|ping|remote))?$', re.IGNORECASE)
_UNAME_RE = re.compile(r'([^:]+)(:(member|ping|remote))?$', re.IGNORECASE)
_TEMPLATE_RE = re.compile(r'@(.+)$')
_RA_TYPE_RE = re.compile(r'[a-z0-9_:-]+$', re.IGNORECASE)
_TAG_RE = re.compile(r"([a-zA-Z_][^\s:]*):?$")
Expand Down Expand Up @@ -866,7 +866,7 @@ def parse_node(self, cmd):
[attributes <param>=<value> [<param>=<value>...]]
[utilization <param>=<value> [<param>=<value>...]]

type :: normal | member | ping | remote
type :: member | ping | remote
"""
self.begin(cmd, min_args=1)
self.match('node')
Expand Down
8 changes: 1 addition & 7 deletions crmsh/ra.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,14 +496,8 @@ def reqd_params_list():
def unreq_param(p):
'''
Allow for some exceptions.

- the rhcs stonith agents sometimes require "action" (in
the meta-data) and "port", but they're automatically
supplied by stonithd
'''
if self.ra_class == "stonith" and \
(self.ra_type.startswith("rhcs/") or
self.ra_type.startswith("fence_")):
if self.ra_class == "stonith" and self.ra_type.startswith("fence_"):
if p in ("action", "port"):
return True
return False
Expand Down
4 changes: 2 additions & 2 deletions crmsh/rsctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@
"""
Run test for stonith resource
"""
for prefix in ['rhcs/', 'fence_']:
for prefix in ['fence_', ]:

Check warning on line 366 in crmsh/rsctest.py

View check run for this annotation

Codecov / codecov/patch

crmsh/rsctest.py#L366

Added line #L366 was not covered by tests
if self.ra_type.startswith(prefix):
self.err("Cannot test RHCS STONITH resources!")
self.err("Cannot test STONITH resources!")

Check warning on line 368 in crmsh/rsctest.py

View check run for this annotation

Codecov / codecov/patch

crmsh/rsctest.py#L368

Added line #L368 was not covered by tests
return False
return RADriver.test_resource(self, node)

Expand Down
2 changes: 1 addition & 1 deletion crmsh/ui_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@
rsc_l += el.node.findall("primitive")
else:
rsc_l.append(el.node)
elif xmlutil.is_normal_node(el.node):
elif xmlutil.is_member_node(el.node):

Check warning on line 1251 in crmsh/ui_configure.py

View check run for this annotation

Codecov / codecov/patch

crmsh/ui_configure.py#L1251

Added line #L1251 was not covered by tests
current = "n"
node_l.append(el.node.get("uname"))
else:
Expand Down
4 changes: 2 additions & 2 deletions crmsh/xmlutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@
return cibdump2elem("resources")


def is_normal_node(n):
return n.tag == "node" and (n.get("type") in (None, "normal", "member", ""))
def is_member_node(n):
return n.tag == "node" and (n.get("type") in (None, "member", ""))

Check warning on line 326 in crmsh/xmlutil.py

View check run for this annotation

Codecov / codecov/patch

crmsh/xmlutil.py#L326

Added line #L326 was not covered by tests


def unique_ra(typ, klass, provider):
Expand Down
2 changes: 1 addition & 1 deletion doc/crm.8.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3335,7 +3335,7 @@ node [$id=<id>] <uname>[:<type>]
[utilization [$id=<id>] [<score>:] [rule...]
<param>=<value> [<param>=<value>...]] | $id-ref=<ref>

type :: normal | member | ping | remote
type :: member | ping | remote
...............
Example:
...............
Expand Down