diff options
author | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-06-06 06:43:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-06-06 06:43:34 +0000 |
commit | a1758a360cbc2d59aa0819b78050671b4839e005 (patch) | |
tree | 9b98556d85eb24bebada7bfdc6380fd7ad5af562 /qtip/cli/commands | |
parent | 1b507724e4cd0542b654a96e7b59a6f6463f2848 (diff) | |
parent | cb3795a39882bb97c15ae5c9562faf577334399b (diff) |
Merge "Beautify the argument names"
Diffstat (limited to 'qtip/cli/commands')
-rw-r--r-- | qtip/cli/commands/cmd_project.py | 37 |
1 files changed, 21 insertions, 16 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}" |