@@ -117,10 +117,11 @@ def test_project_purge_with_project(self):
117117 self .projects_mock .get .assert_called_once_with (self .project .id )
118118 self .projects_mock .delete .assert_called_once_with (self .project .id )
119119 self .servers_mock .list .assert_called_once_with (
120- search_opts = {'tenant_id' : self .project .id })
120+ search_opts = {'tenant_id' : self .project .id , 'all_tenants' : True })
121121 kwargs = {'filters' : {'owner' : self .project .id }}
122122 self .images_mock .list .assert_called_once_with (** kwargs )
123- volume_search_opts = {'project_id' : self .project .id }
123+ volume_search_opts = {'project_id' : self .project .id ,
124+ 'all_tenants' : True }
124125 self .volumes_mock .list .assert_called_once_with (
125126 search_opts = volume_search_opts )
126127 self .snapshots_mock .list .assert_called_once_with (
@@ -152,10 +153,11 @@ def test_project_purge_with_dry_run(self):
152153 self .projects_mock .get .assert_called_once_with (self .project .id )
153154 self .projects_mock .delete .assert_not_called ()
154155 self .servers_mock .list .assert_called_once_with (
155- search_opts = {'tenant_id' : self .project .id })
156+ search_opts = {'tenant_id' : self .project .id , 'all_tenants' : True })
156157 kwargs = {'filters' : {'owner' : self .project .id }}
157158 self .images_mock .list .assert_called_once_with (** kwargs )
158- volume_search_opts = {'project_id' : self .project .id }
159+ volume_search_opts = {'project_id' : self .project .id ,
160+ 'all_tenants' : True }
159161 self .volumes_mock .list .assert_called_once_with (
160162 search_opts = volume_search_opts )
161163 self .snapshots_mock .list .assert_called_once_with (
@@ -187,10 +189,11 @@ def test_project_purge_with_keep_project(self):
187189 self .projects_mock .get .assert_called_once_with (self .project .id )
188190 self .projects_mock .delete .assert_not_called ()
189191 self .servers_mock .list .assert_called_once_with (
190- search_opts = {'tenant_id' : self .project .id })
192+ search_opts = {'tenant_id' : self .project .id , 'all_tenants' : True })
191193 kwargs = {'filters' : {'owner' : self .project .id }}
192194 self .images_mock .list .assert_called_once_with (** kwargs )
193- volume_search_opts = {'project_id' : self .project .id }
195+ volume_search_opts = {'project_id' : self .project .id ,
196+ 'all_tenants' : True }
194197 self .volumes_mock .list .assert_called_once_with (
195198 search_opts = volume_search_opts )
196199 self .snapshots_mock .list .assert_called_once_with (
@@ -223,10 +226,11 @@ def test_project_purge_with_auth_project(self):
223226 self .projects_mock .get .assert_not_called ()
224227 self .projects_mock .delete .assert_called_once_with (self .project .id )
225228 self .servers_mock .list .assert_called_once_with (
226- search_opts = {'tenant_id' : self .project .id })
229+ search_opts = {'tenant_id' : self .project .id , 'all_tenants' : True })
227230 kwargs = {'filters' : {'owner' : self .project .id }}
228231 self .images_mock .list .assert_called_once_with (** kwargs )
229- volume_search_opts = {'project_id' : self .project .id }
232+ volume_search_opts = {'project_id' : self .project .id ,
233+ 'all_tenants' : True }
230234 self .volumes_mock .list .assert_called_once_with (
231235 search_opts = volume_search_opts )
232236 self .snapshots_mock .list .assert_called_once_with (
@@ -259,10 +263,11 @@ def test_project_purge_with_exception(self, mock_error):
259263 self .projects_mock .get .assert_called_once_with (self .project .id )
260264 self .projects_mock .delete .assert_called_once_with (self .project .id )
261265 self .servers_mock .list .assert_called_once_with (
262- search_opts = {'tenant_id' : self .project .id })
266+ search_opts = {'tenant_id' : self .project .id , 'all_tenants' : True })
263267 kwargs = {'filters' : {'owner' : self .project .id }}
264268 self .images_mock .list .assert_called_once_with (** kwargs )
265- volume_search_opts = {'project_id' : self .project .id }
269+ volume_search_opts = {'project_id' : self .project .id ,
270+ 'all_tenants' : True }
266271 self .volumes_mock .list .assert_called_once_with (
267272 search_opts = volume_search_opts )
268273 self .snapshots_mock .list .assert_called_once_with (
@@ -295,10 +300,11 @@ def test_project_purge_with_force_delete_backup(self):
295300 self .projects_mock .get .assert_called_once_with (self .project .id )
296301 self .projects_mock .delete .assert_called_once_with (self .project .id )
297302 self .servers_mock .list .assert_called_once_with (
298- search_opts = {'tenant_id' : self .project .id })
303+ search_opts = {'tenant_id' : self .project .id , 'all_tenants' : True })
299304 kwargs = {'filters' : {'owner' : self .project .id }}
300305 self .images_mock .list .assert_called_once_with (** kwargs )
301- volume_search_opts = {'project_id' : self .project .id }
306+ volume_search_opts = {'project_id' : self .project .id ,
307+ 'all_tenants' : True }
302308 self .volumes_mock .list .assert_called_once_with (
303309 search_opts = volume_search_opts )
304310 self .snapshots_mock .list .assert_called_once_with (
0 commit comments