Merge "Get auth token when checking deployment"
[functest-xtesting.git] / functest / cli / commands / cli_os.py
index 71cd78c..9057da8 100644 (file)
@@ -9,14 +9,12 @@
 
 
 import os
-from urlparse import urlparse
 
 import click
+from six.moves.urllib.parse import urlparse
 
 from functest.ci import check_deployment
 from functest.utils.constants import CONST
-import functest.utils.openstack_clean as os_clean
-import functest.utils.openstack_snapshot as os_snapshot
 
 
 class OpenStack(object):
@@ -26,7 +24,6 @@ class OpenStack(object):
         self.endpoint_ip = None
         self.endpoint_port = None
         self.openstack_creds = CONST.__getattribute__('openstack_creds')
-        self.snapshot_file = CONST.__getattribute__('openstack_snapshot_file')
         if self.os_auth_url:
             self.endpoint_ip = urlparse(self.os_auth_url).hostname
             self.endpoint_port = urlparse(self.os_auth_url).port
@@ -55,43 +52,6 @@ class OpenStack(object):
         deployment = check_deployment.CheckDeployment()
         deployment.check_all()
 
-    def snapshot_create(self):
-        self.ping_endpoint()
-        if os.path.isfile(self.snapshot_file):
-            answer = raw_input("It seems there is already an OpenStack "
-                               "snapshot. Do you want to overwrite it with "
-                               "the current OpenStack status? [y|n]\n")
-            while True:
-                if answer.lower() in ["y", "yes"]:
-                    break
-                elif answer.lower() in ["n", "no"]:
-                    return
-                else:
-                    answer = raw_input("Invalid answer. Please type [y|n]\n")
-
-        click.echo("Generating Openstack snapshot...")
-        os_snapshot.main()
-
-    def snapshot_show(self):
-        if not os.path.isfile(self.snapshot_file):
-            click.echo("There is no OpenStack snapshot created. To create "
-                       "one run the command "
-                       "'functest openstack snapshot-create'")
-            return
-        with open(self.snapshot_file, 'r') as yaml_file:
-            click.echo("\n%s"
-                       % yaml_file.read())
-
-    def clean(self):
-        self.ping_endpoint()
-        if not os.path.isfile(self.snapshot_file):
-            click.echo("Not possible to clean OpenStack without a snapshot. "
-                       "This could cause problems. "
-                       "Run first the command "
-                       "'functest openstack snapshot-create'")
-            return
-        os_clean.main()
-
 
 class CliOpenStack(OpenStack):