Remove prompts for options while creating workspace 39/34439/4
authorTaseer <taseer94@gmail.com>
Mon, 8 May 2017 15:16:36 +0000 (20:16 +0500)
committerTaseer <taseer94@gmail.com>
Tue, 9 May 2017 14:45:24 +0000 (19:45 +0500)
Change-Id: Ic1b4bfbcefa6240fdab193e411cce4725a6835e7
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
qtip/cli/commands/cmd_workspace.py
resources/ansible_roles/qtip-workspace/create.yml

index 9636f7f..42d4e2d 100644 (file)
@@ -21,10 +21,20 @@ def cli():
 
 
 @cli.command("create", help="Create QTIP workspace")
-def create():
+@click.option('--pod', default='unknown', help='Name of pod under test')
+@click.option('--installer', help='OPNFV installer')
+@click.option('--master-host', help='Installer hostname')
+@click.option('--scenario', default='unknown', help='OPNFV scenario')
+@click.argument('name')
+def create(pod, installer, master_host, scenario, name):
     extra_vars = {
         'qtip_package': utils.QTIP_PACKAGE,
-        'cwd': os.getcwd()
+        'cwd': os.getcwd(),
+        'pod_name': pod,
+        'installer': installer,
+        'scenario': scenario,
+        'installer_master_host': master_host,
+        'workspace': name
     }
     os.system("ANSIBLE_ROLES_PATH={qtip_package}/{roles_path} ansible-playbook"
               " {qtip_package}/{roles_path}/qtip-workspace/create.yml"
index 66a8cf3..4b06ebf 100644 (file)
 
   gather_facts: no
 
-  vars_prompt:
-
-    - name: pod_name
-      prompt: 'name of the pod under test (used in reporting)'
-      default: qtip-pod
-      private: no
-
-    - name: scenario
-      prompt: 'scenario deployed in the pod:'
-      default: default
-      private: no
-
-    - name: installer
-      prompt: 'installer type of the pod (apex|fuel)'
-      default: fuel
-      private: no
-
-    - name: installer_master_host
-      prompt: 'master host/vm of the installer (accessible by `ssh <hostname>`)'
-      private: no
-
-    - name: workspace
-      prompt: 'workspace name (new directory will be created)'
-      default: workspace
-      private: no
-
   roles:
 
     - role: qtip-workspace