entry_point.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:cinch 作者: RedHatQE 项目源码 文件源码
def cinch_generic(playbook):
    # Parse the command line arguments
    parser = ArgumentParser(description='A wrapper around Cinch for the most '
                            'common use case')
    # The inventory file that the user provides which will get passed along to
    # Ansible for its consumption
    parser.add_argument('inventory')
    # All remaining arguments are passed through, untouched, to Ansible
    parser.add_argument('args', nargs=REMAINDER)
    args = parser.parse_args()
    if len(args.inventory) > 0:
        if args.inventory[0] == '/':
            inventory = args.inventory
        else:
            inventory = path.join(getcwd(), args.inventory)
    else:
        raise Exception('Inventory path needs to be non-empty')
    exit_code = call_ansible(inventory, playbook, args.args)
    sys.exit(exit_code)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号