Skip to content

Commit

Permalink
rsc-cmds: involved remove debug output and fix removing elements
Browse files Browse the repository at this point in the history
  • Loading branch information
rp- committed Apr 28, 2021
1 parent c0a2626 commit adfb1b1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions linstor_client/commands/rsc_cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def _filter_involved_resources(
:param bool only_inuse: only show resource bundles that are inuse
:param bool only_diskless_inuse: only show resource bundles where the inuse node is diskless
:param Optional[int] min_replicas: only show resource bundles that have less diskful replicas
:return: A RscRespWrapper object with the filtered resources
:return: The res_response argument with filtered resources
:rtype: RscRespWrapper
"""
res_del = set()
Expand Down Expand Up @@ -539,12 +539,13 @@ def _filter_involved_resources(
res_del.add(i)
if only_diskless_inuse and not look_rsc['diskless-inuse']:
res_del.add(i)
print(rsc.name, look_rsc['replicas'])
if min_replicas is not None and min_replicas <= look_rsc['replicas']:
res_del.add(i)
for ri in reversed(list(res_del)):
res_del_list = list(res_del)
res_del_list.sort()
for ri in reversed(res_del_list):
del res_response.resources[ri]
return res_del
return res_response

def show(self, args, lstmsg):
"""
Expand Down

0 comments on commit adfb1b1

Please sign in to comment.