aboutsummaryrefslogtreecommitdiffstats
path: root/functest/cli
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-12-12 06:48:33 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2017-12-12 07:00:26 +0100
commit7a07dd0968ab9775e7bbfd59ff19bddcb8605af4 (patch)
tree793e9806187b4d734e40b8983539e653b0b981ae /functest/cli
parent55733974628202786705227b7d6e9bb50558823d (diff)
Add python3 support in cli
Change-Id: I222fde91cf236a272176bc2d9ec6732f98b76141 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/cli')
-rw-r--r--functest/cli/commands/cli_env.py4
-rw-r--r--functest/cli/commands/cli_os.py13
2 files changed, 11 insertions, 6 deletions
diff --git a/functest/cli/commands/cli_env.py b/functest/cli/commands/cli_env.py
index 0e0afe52..c41f8f34 100644
--- a/functest/cli/commands/cli_env.py
+++ b/functest/cli/commands/cli_env.py
@@ -12,6 +12,8 @@ import prettytable
from functest.utils.constants import CONST
+import six
+
class Env(object):
@@ -52,7 +54,7 @@ class CliEnv(Env):
msg = prettytable.PrettyTable(
header_style='upper', padding_width=5,
field_names=['Functest Environment', 'value'])
- for key, value in env_info.iteritems():
+ for key, value in six.iteritems(env_info):
if key is not None:
msg.add_row([key, value])
click.echo(msg.get_string())
diff --git a/functest/cli/commands/cli_os.py b/functest/cli/commands/cli_os.py
index 71cd78c5..1ec705a5 100644
--- a/functest/cli/commands/cli_os.py
+++ b/functest/cli/commands/cli_os.py
@@ -9,9 +9,10 @@
import os
-from urlparse import urlparse
import click
+import six
+from six.moves.urllib.parse import urlparse
from functest.ci import check_deployment
from functest.utils.constants import CONST
@@ -58,16 +59,18 @@ class OpenStack(object):
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")
+ 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 = raw_input("Invalid answer. Please type [y|n]\n")
+ answer = six.moves.input(
+ "Invalid answer. Please type [y|n]\n")
click.echo("Generating Openstack snapshot...")
os_snapshot.main()