aboutsummaryrefslogtreecommitdiffstats
path: root/functest/cli
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-12-19 19:58:15 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2017-12-19 20:40:45 +0100
commit00c01aeafab54ec7b9ea376099fb6aaff0da5f5a (patch)
tree486d4d762305fdbf9099f2064a0e38998ec15e31 /functest/cli
parentafa5e6098c7fd24ee2a9259a5dbff64a3e2d0a68 (diff)
Remove openstack_[clean,snapshot]
It also removes the related unit tests and updates docs and cli. Change-Id: Ie11f77402f2b5b7055a0c7c5d931c8ff21124482 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/cli')
-rw-r--r--functest/cli/cli_base.py17
-rw-r--r--functest/cli/commands/cli_os.py43
2 files changed, 0 insertions, 60 deletions
diff --git a/functest/cli/cli_base.py b/functest/cli/cli_base.py
index aa8ab24bc..5890e0a35 100644
--- a/functest/cli/cli_base.py
+++ b/functest/cli/cli_base.py
@@ -64,23 +64,6 @@ def os_check():
_openstack.check()
-@openstack.command('snapshot-create', help="Generates a snapshot of the "
- "current OpenStack resources.")
-def os_snapshot_create():
- _openstack.snapshot_create()
-
-
-@openstack.command('snapshot-show', help="Prints the OpenStack snapshot.")
-def os_snapshot_show():
- _openstack.snapshot_show()
-
-
-@openstack.command('clean',
- help="Cleans the OpenStack resources except the snapshot.")
-def os_clean():
- _openstack.clean()
-
-
@openstack.command('show-credentials',
help="Prints the OpenStack credentials.")
def os_show_credentials():
diff --git a/functest/cli/commands/cli_os.py b/functest/cli/commands/cli_os.py
index 1ec705a5d..9057da84b 100644
--- a/functest/cli/commands/cli_os.py
+++ b/functest/cli/commands/cli_os.py
@@ -11,13 +11,10 @@
import os
import click
-import six
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):
@@ -27,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
@@ -56,45 +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 = six.moves.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 = six.moves.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):