diff --git a/crmsh/cibconfig.py b/crmsh/cibconfig.py index 9fe231eee4..81807cfaed 100644 --- a/crmsh/cibconfig.py +++ b/crmsh/cibconfig.py @@ -3223,7 +3223,7 @@ def filter_objects(self, filters): obj_set = orderedset.oset([]) and_filter, and_set = False, None for spec in filters: - if spec == "or": + if spec in ["or", "from_show"]: continue elif spec == "and": and_filter, and_set = True, obj_set @@ -3231,6 +3231,8 @@ def filter_objects(self, filters): continue if spec == "changed": obj_set |= orderedset.oset(self.modified_elems()) + if "from_show" in filters: + obj_set |= orderedset.oset(self.remove_queue) elif spec.startswith("type:"): obj_set |= orderedset.oset(self.get_elems_on_type(spec)) elif spec.startswith("tag:"): diff --git a/crmsh/ui_configure.py b/crmsh/ui_configure.py index e3fced4c40..253471ab43 100644 --- a/crmsh/ui_configure.py +++ b/crmsh/ui_configure.py @@ -551,6 +551,8 @@ def do_show(self, context, *args): from .utils import obscure osargs = [arg[8:] for arg in args if arg.startswith('obscure:')] args = [arg for arg in args if not arg.startswith('obscure:')] + if "changed" in args: + args.append("from_show") with obscure(osargs): set_obj = mkset_obj(*args) return set_obj.show() diff --git a/test/testcases/commit b/test/testcases/commit index 3f0117c2ad..b2b1bda9b4 100644 --- a/test/testcases/commit +++ b/test/testcases/commit @@ -33,6 +33,7 @@ commit filter "sed '/g1/s/p1/d1/'" group g2 d3 d2 delete d2 +show changed commit _test verify diff --git a/test/testcases/commit.exp b/test/testcases/commit.exp index 4ebf35f214..a09749cecd 100644 --- a/test/testcases/commit.exp +++ b/test/testcases/commit.exp @@ -43,10 +43,14 @@ INFO: 24: modified colocation:cl1 from c1 to g1 .INP: filter "sed '/g1/s/p1/d1/'" .INP: group g2 d3 d2 .INP: delete d2 +.INP: show changed +primitive d2 Dummy +group g1 d1 p2 +group g2 d3 .INP: commit .INP: _test .INP: verify -WARNING: 35: st: unknown attribute 'yoyo-meta' +WARNING: 36: st: unknown attribute 'yoyo-meta' .INP: show node node1 \ attributes mem=16G @@ -70,5 +74,5 @@ order o1 inf: p3 g1 op_defaults op-options: \ timeout=2m .INP: commit -INFO: 37: apparently there is nothing to commit -INFO: 37: try changing something first +INFO: 38: apparently there is nothing to commit +INFO: 38: try changing something first