Merge "Respect --skip-resource when deleting."

This commit is contained in:
Zuul 2024-08-01 13:21:54 +00:00 committed by Gerrit Code Review
commit a59262e44d
2 changed files with 34 additions and 6 deletions

View File

@ -150,5 +150,8 @@ class ProjectCleanup(command.Command):
self.log.warning(_('Deleting resources'))
project_connect.project_cleanup(
dry_run=False, status_queue=status_queue, filters=filters
dry_run=False,
status_queue=status_queue,
filters=filters,
skip_resources=parsed_args.skip_resource,
)

View File

@ -83,7 +83,12 @@ class TestProjectCleanup(test_utils.TestCommand):
filters=filters,
skip_resources=None,
),
mock.call(dry_run=False, status_queue=mock.ANY, filters=filters),
mock.call(
dry_run=False,
status_queue=mock.ANY,
filters=filters,
skip_resources=None,
),
]
self.project_cleanup_mock.assert_has_calls(calls)
@ -114,7 +119,12 @@ class TestProjectCleanup(test_utils.TestCommand):
filters={},
skip_resources=None,
),
mock.call(dry_run=False, status_queue=mock.ANY, filters={}),
mock.call(
dry_run=False,
status_queue=mock.ANY,
filters={},
skip_resources=None,
),
]
self.project_cleanup_mock.assert_has_calls(calls)
@ -144,7 +154,12 @@ class TestProjectCleanup(test_utils.TestCommand):
filters={},
skip_resources=None,
),
mock.call(dry_run=False, status_queue=mock.ANY, filters={}),
mock.call(
dry_run=False,
status_queue=mock.ANY,
filters={},
skip_resources=None,
),
]
self.project_cleanup_mock.assert_has_calls(calls)
@ -230,7 +245,12 @@ class TestProjectCleanup(test_utils.TestCommand):
filters={},
skip_resources=None,
),
mock.call(dry_run=False, status_queue=mock.ANY, filters={}),
mock.call(
dry_run=False,
status_queue=mock.ANY,
filters={},
skip_resources=None,
),
]
self.project_cleanup_mock.assert_has_calls(calls)
@ -260,7 +280,12 @@ class TestProjectCleanup(test_utils.TestCommand):
filters={},
skip_resources=[skip_resource],
),
mock.call(dry_run=False, status_queue=mock.ANY, filters={}),
mock.call(
dry_run=False,
status_queue=mock.ANY,
filters={},
skip_resources=[skip_resource],
),
]
self.project_cleanup_mock.assert_has_calls(calls)