aboutsummaryrefslogtreecommitdiffstats
path: root/functest/cli
diff options
context:
space:
mode:
Diffstat (limited to 'functest/cli')
-rw-r--r--functest/cli/cli_base.py6
-rw-r--r--functest/cli/commands/cli_env.py27
-rw-r--r--functest/cli/commands/cli_os.py28
-rw-r--r--functest/cli/setup.py15
4 files changed, 13 insertions, 63 deletions
diff --git a/functest/cli/cli_base.py b/functest/cli/cli_base.py
index 2104e125..2f085834 100644
--- a/functest/cli/cli_base.py
+++ b/functest/cli/cli_base.py
@@ -86,12 +86,6 @@ def os_show_credentials():
_openstack.show_credentials()
-@openstack.command('fetch-rc', help="Fetch the OpenStack RC file from "
- "the installer.")
-def os_fetch_rc():
- _openstack.fetch_credentials()
-
-
@env.command('prepare', help="Prepares the Functest environment. This step is "
"needed run the tests.")
def env_prepare():
diff --git a/functest/cli/commands/cli_env.py b/functest/cli/commands/cli_env.py
index f5ba4b34..b43116fc 100644
--- a/functest/cli/commands/cli_env.py
+++ b/functest/cli/commands/cli_env.py
@@ -11,6 +11,7 @@ import os
import click
import git
+import prettytable
from functest.utils.constants import CONST
import functest.utils.functest_utils as ft_utils
@@ -66,21 +67,19 @@ class CliEnv(object):
if self.status(verbose=False) == 0:
STATUS = "ready"
- click.echo("+======================================================+")
- click.echo("| Functest Environment info |")
- click.echo("+======================================================+")
- click.echo("| INSTALLER: %s|" % installer_info.ljust(41))
- click.echo("| SCENARIO: %s|" % scenario.ljust(41))
- click.echo("| POD: %s|" % node.ljust(41))
- click.echo("| GIT BRACNH: %s|" % git_branch.ljust(41))
- click.echo("| GIT HASH: %s|" % git_hash.ljust(41))
+ msg = prettytable.PrettyTable(
+ header_style='upper', padding_width=5,
+ field_names=['Functest Environment', 'value'])
+ msg.add_row(['INSTALLER', installer_info])
+ msg.add_row(['SCENARIO', scenario])
+ msg.add_row(['POD', node])
+ msg.add_row(['GIT BRANCH', git_branch])
+ msg.add_row(['GIT HASH', git_hash])
if build_tag:
- click.echo("| BUILD TAG: %s|" % build_tag.ljust(41))
- click.echo("| DEBUG FLAG: %s|" % is_debug.ljust(41))
- click.echo("+------------------------------------------------------+")
- click.echo("| STATUS: %s|" % STATUS.ljust(41))
- click.echo("+------------------------------------------------------+")
- click.echo("")
+ msg.add_row(['BUILD TAG', build_tag])
+ msg.add_row(['DEBUG FLAG', is_debug])
+ msg.add_row(['STATUS', STATUS])
+ click.echo(msg.get_string())
def status(self, verbose=True):
ret_val = 0
diff --git a/functest/cli/commands/cli_os.py b/functest/cli/commands/cli_os.py
index 5e6e1109..c66362fc 100644
--- a/functest/cli/commands/cli_os.py
+++ b/functest/cli/commands/cli_os.py
@@ -47,34 +47,6 @@ class CliOpenStack(object):
if key.startswith('OS_'):
click.echo("{}={}".format(key, value))
- def fetch_credentials(self):
- if os.path.isfile(self.openstack_creds):
- answer = raw_input("It seems the RC file is already present. "
- "Do you want to overwrite it? [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")
-
- installer_type = CONST.__getattribute__('INSTALLER_TYPE')
- if installer_type is None:
- click.echo("The environment variable 'INSTALLER_TYPE' is not"
- "defined. Please export it")
- installer_ip = CONST.__getattribute__('INSTALLER_IP')
- if installer_ip is None:
- click.echo("The environment variable 'INSTALLER_IP' is not"
- "defined. Please export it")
- cmd = ("fetch_os_creds.sh -d %s -i %s -a %s"
- % (self.openstack_creds,
- installer_type,
- installer_ip))
- click.echo("Fetching credentials from installer node '%s' with IP=%s.."
- % (installer_type, installer_ip))
- ft_utils.execute_command(cmd, verbose=False)
-
def check(self):
self.ping_endpoint()
cmd = os.path.join(CONST.__getattribute__('dir_repo_functest'),
diff --git a/functest/cli/setup.py b/functest/cli/setup.py
deleted file mode 100644
index 21547e15..00000000
--- a/functest/cli/setup.py
+++ /dev/null
@@ -1,15 +0,0 @@
-from setuptools import setup
-
-setup(
- name='functest',
- version='colorado.0.1',
- py_modules=['cli_base'],
- include_package_data=True,
- install_requires=[
- 'click',
- ],
- entry_points='''
- [console_scripts]
- functest=cli_base:cli
- ''',
-)