diff options
author | 2017-05-08 11:09:02 +0800 | |
---|---|---|
committer | 2017-05-15 08:24:35 +0000 | |
commit | f20effca792bb5dfa2898585f3431de5d296064f (patch) | |
tree | 2323e6d85a03d8673e1a5fc89d7658f1575cb2e5 /deploy/adapters/ansible/roles/moon/files/get_deb_depends.py | |
parent | f0f025b1137da4ab12b0db76620c332fac3335bc (diff) |
Update moon role for moonv4
JIRA: -
To deploy moon(master/slave) scenario configure moon role in DHA file like:
- name: host4
roles:
- moon
To deploy moon master, export MOON_CFG env like below compass deploy:
export MOON_CFG="master:flag=Disable,slave:flag=Enable,slave:name=slave1,slave:master_ip=master_ip"
To deploy moon slave, export MOON_CFG env like below compass deploy:
export MOON_CFG="master:flag=Enable,slave:flag=Disable,slave:name=slave1,slave:master_ip=master_ip"
Change-Id: Ie300a85979af31634ab0660ccee1ee8b094110b5
Signed-off-by: QiLiang <liangqi1@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/moon/files/get_deb_depends.py')
-rw-r--r-- | deploy/adapters/ansible/roles/moon/files/get_deb_depends.py | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/deploy/adapters/ansible/roles/moon/files/get_deb_depends.py b/deploy/adapters/ansible/roles/moon/files/get_deb_depends.py deleted file mode 100644 index e01c1ff7..00000000 --- a/deploy/adapters/ansible/roles/moon/files/get_deb_depends.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python3 -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD 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 sys -import subprocess - -pkts = [] - -for arg in sys.argv[1:]: - proc = subprocess.Popen(["dpkg-deb", - "--info", - arg], - stdin=None, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - out = proc.stdout.read() - err = proc.stderr.read() - if err: - print("An error occurred with {} ({})".format(arg, err)) - continue - for line in out.splitlines(): - line = line.decode('utf-8') - if " Depends:" in line: - line = line.replace(" Depends:", "") - for _dep in line.split(','): - pkts.append(_dep.split()[0]) - -print(" ".join(pkts)) |