For the case when the non-global level does not have a schedule
and a higher level is used as the parent, it wrongly listed
schedules from all branches under the parent, instead of only the
interested one.
Signed-off-by: Mykola Golub <mgolub@suse.com>
expect_fail rbd trash purge schedule ls -p rbd2
rbd trash purge schedule ls -p rbd2 -R | grep 'every 2d starting at 00:17'
rbd trash purge schedule ls -p rbd2/ns1 -R | grep 'every 2d starting at 00:17'
+ test "$(rbd trash purge schedule ls -R -p rbd2/ns1 --format xml |
+ $XMLSTARLET sel -t -v '//schedules/schedule/pool')" = "-"
+ test "$(rbd trash purge schedule ls -R -p rbd2/ns1 --format xml |
+ $XMLSTARLET sel -t -v '//schedules/schedule/namespace')" = "-"
+ test "$(rbd trash purge schedule ls -R -p rbd2/ns1 --format xml |
+ $XMLSTARLET sel -t -v '//schedules/schedule/items/item/start_time')" = "00:17:00"
for i in `seq 12`; do
rbd trash purge schedule status --format xml |
result = {}
for level_spec_id, schedule in self.schedules.items():
ls = self.level_specs[level_spec_id]
- if ls == parent or ls.is_child_of(parent):
+ if ls == parent or ls == level_spec or ls.is_child_of(level_spec):
result[level_spec_id] = {
'name' : schedule.name,
'schedule' : schedule.to_list(),