diff --git a/openstackclient/common/project_cleanup.py b/openstackclient/common/project_cleanup.py index 2ac156cba5..0c143fad3f 100644 --- a/openstackclient/common/project_cleanup.py +++ b/openstackclient/common/project_cleanup.py @@ -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, ) diff --git a/openstackclient/tests/unit/common/test_project_cleanup.py b/openstackclient/tests/unit/common/test_project_cleanup.py index 019d6cf157..50d4e6487c 100644 --- a/openstackclient/tests/unit/common/test_project_cleanup.py +++ b/openstackclient/tests/unit/common/test_project_cleanup.py @@ -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)