diff options
author | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-05-08 06:28:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-05-08 06:28:34 +0000 |
commit | 28769eb7866a0fd362dd68e9ea545a82f136c679 (patch) | |
tree | f241554361ee8b45d36e7ee2d3ac917a917bb9ff /qtip/cli/commands/cmd_workspace.py | |
parent | f25075b0dd2656efd1daae10c4739f029788c83f (diff) | |
parent | ebf4e585a6bbc7a08c5e779ff9863436e44484d8 (diff) |
Merge "Implement qtip workspace create"
Diffstat (limited to 'qtip/cli/commands/cmd_workspace.py')
-rw-r--r-- | qtip/cli/commands/cmd_workspace.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/qtip/cli/commands/cmd_workspace.py b/qtip/cli/commands/cmd_workspace.py new file mode 100644 index 00000000..9636f7fb --- /dev/null +++ b/qtip/cli/commands/cmd_workspace.py @@ -0,0 +1,34 @@ +############################################################################## +# Copyright (c) 2017 taseer94@gmail.com and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + +import click +import os + +from qtip.cli import utils + + +@click.group() +def cli(): + """ Manage QTIP workspace """ + pass + + +@cli.command("create", help="Create QTIP workspace") +def create(): + extra_vars = { + 'qtip_package': utils.QTIP_PACKAGE, + 'cwd': os.getcwd() + } + os.system("ANSIBLE_ROLES_PATH={qtip_package}/{roles_path} ansible-playbook" + " {qtip_package}/{roles_path}/qtip-workspace/create.yml" + " --extra-vars '{extra_vars}'" + "".format(qtip_package=utils.QTIP_PACKAGE, + roles_path=utils.ROLES_PATH, + extra_vars=utils.join_vars(**extra_vars))) |