Fix cleanup command
There are few issues in cleanup command which makes it
in failure state.
1. Deprecated tenant name of identity grp is being used
- Devstack does not set these deprecated options now so it fails
with tenant Not Found
2. Running cleanup operation for --init-saved-state option too
- --init-saved-state option should just save the state not run actual
cleanup. After states are saved, user should be able to verify/edit that and
then run cleanup in normal mode.
With above issues fix, cleanup command runs successfully.
Change-Id: Ifd393d1f8d6e070e52e2a0a2d42a765cd6d4f5f5
diff --git a/tempest/cmd/cleanup.py b/tempest/cmd/cleanup.py
index c8a8159..5a52043 100644
--- a/tempest/cmd/cleanup.py
+++ b/tempest/cmd/cleanup.py
@@ -77,7 +77,8 @@
def take_action(self, parsed_args):
try:
self.init(parsed_args)
- self._cleanup()
+ if not parsed_args.init_saved_state:
+ self._cleanup()
except Exception:
LOG.exception("Failure during cleanup")
traceback.print_exc()
diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py
index 33f19b1..5ec8008 100644
--- a/tempest/cmd/cleanup_service.py
+++ b/tempest/cmd/cleanup_service.py
@@ -78,7 +78,7 @@
if IS_NEUTRON:
CONF_PRIV_NETWORK = _get_network_id(CONF.compute.fixed_network_name,
- CONF.identity.tenant_name)
+ CONF.auth.admin_tenant_name)
CONF_NETWORKS = [CONF_PUB_NETWORK, CONF_PRIV_NETWORK]