def _cleanup_admin_resources(self): try: admin = osclients.Clients(self.admin) utils.delete_keystone_resources(admin.keystone()) except Exception as e: LOG.debug("Not all resources were cleaned.", exc_info=sys.exc_info()) LOG.warning(_("Unable to fully cleanup keystone service: %s") % (six.text_type(e)))
def test_delete_keystone_resources(self, mock_wrap): keystone = fakes.FakeClients().keystone() mock_wrap.return_value = keystone keystone.users.create("rally_keystone_dummy", None, None, None) total = lambda keystone: (len(keystone.users.list())) self.assertEqual(total(keystone), 1) utils.delete_keystone_resources(keystone) self.assertEqual(total(keystone), 0)
def _cleanup_admin_resources(self): try: admin = osclients.Clients(self.admin) utils.delete_keystone_resources(admin.keystone()) except Exception as e: LOG.debug("Not all resources were cleaned.", exc_info=sys.exc_info()) LOG.warning(_('Unable to fully cleanup keystone service: %s') % (six.text_type(e)))