Skip to content

Commit

Permalink
[crmsh-4.6] Dev: ui_node: Improve command 'clearstate <node>' (#1535)
Browse files Browse the repository at this point in the history
backport #1534
  • Loading branch information
liangxin1300 authored Sep 6, 2024
2 parents 48952f7 + f0b7c2b commit b10a818
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crmsh/ui_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,9 @@ def do_clearstate(self, context, node=None):
if cib_elem is None:
return False
crmd = cib_elem.xpath("//node_state[@uname=\"%s\"]/@crmd" % node)
if not crmd:
logger.error("Node '%s' not found in CIB", node)
return False
if crmd == ["online"] or (crmd[0].isdigit() and int(crmd[0]) != 0):
return utils.ext_cmd(self.node_cleanup_resources % node) == 0
in_ccm = cib_elem.xpath("//node_state[@uname=\"%s\"]/@in_ccm" % node)
Expand Down

0 comments on commit b10a818

Please sign in to comment.