summaryrefslogtreecommitdiffstats
path: root/qtip
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-06-06 06:43:34 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-06-06 06:43:34 +0000
commita1758a360cbc2d59aa0819b78050671b4839e005 (patch)
tree9b98556d85eb24bebada7bfdc6380fd7ad5af562 /qtip
parent1b507724e4cd0542b654a96e7b59a6f6463f2848 (diff)
parentcb3795a39882bb97c15ae5c9562faf577334399b (diff)
Merge "Beautify the argument names"
Diffstat (limited to 'qtip')
-rw-r--r--qtip/cli/commands/cmd_project.py37
-rw-r--r--qtip/cli/utils.py2
2 files changed, 22 insertions, 17 deletions
diff --git a/qtip/cli/commands/cmd_project.py b/qtip/cli/commands/cmd_project.py
index f7ac3a83..b32e71cd 100644
--- a/qtip/cli/commands/cmd_project.py
+++ b/qtip/cli/commands/cmd_project.py
@@ -39,31 +39,36 @@ def cli():
@cli.command(help="Create new testing project")
-@click.option('--template',
- prompt='Choose project template',
+@click.argument('project_name')
+@click.option('--project-template',
type=click.Choice(['compute', 'doctor']),
default='compute',
help='Choose project template')
-@click.option('--pod', default='unknown', prompt='Pod Name',
+@click.option('--pod-name',
+ prompt='Pod Name',
+ default='opnfv-pod',
help='Name of pod under test')
-@click.option('--installer', prompt='OPNFV Installer',
- help='OPNFV installer', default='manual')
-@click.option('--master-host', prompt='Installer Hostname',
- help='Installer hostname', default='dummy-host')
-@click.option('--scenario', prompt='OPNFV Scenario', default='unknown',
+@click.option('--installer-type',
+ type=click.Choice(['apex', 'fuel', 'manual']),
+ prompt='OPNFV Installer Type',
+ default='manual',
+ help='OPNFV installer')
+@click.option('--installer-host',
+ prompt='Installer SSH Host Address',
+ help='Host configured for ssh client or IP addresses and domain name')
+@click.option('--scenario',
help='OPNFV scenario')
-@click.argument('name')
-def create(pod, installer, master_host, scenario, name, template):
+def create(project_name, project_template, pod_name, installer_type, installer_host, scenario):
qtip_generator_role = os.path.join(utils.QTIP_ANSIBLE_ROLES, 'qtip-generator')
extra_vars = {
'qtip_package': utils.QTIP_PACKAGE,
'cwd': os.getcwd(),
- 'pod_name': pod,
- 'installer': installer,
- 'scenario': scenario,
- 'installer_master_host': master_host,
- 'project_name': name,
- 'project_template': template
+ 'project_name': project_name,
+ 'project_template': project_template,
+ 'pod_name': pod_name,
+ 'installer_type': installer_type,
+ 'installer_host': installer_host,
+ 'scenario': scenario
}
os.system("ANSIBLE_ROLES_PATH={roles_path} ansible-playbook"
" -i {hosts}"
diff --git a/qtip/cli/utils.py b/qtip/cli/utils.py
index 0f0e7e95..331d2000 100644
--- a/qtip/cli/utils.py
+++ b/qtip/cli/utils.py
@@ -19,7 +19,7 @@ QTIP_ANSIBLE_ROLES = path.join(QTIP_PACKAGE, 'resources', 'ansible_roles')
def join_vars(**kwargs):
- return " ".join(["{}={}".format(variable, value) for variable, value in kwargs.items()])
+ return " ".join(["{}={}".format(variable, value) for variable, value in kwargs.items() if value is not None])
def table(name, components):