aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/client.py
diff options
context:
space:
mode:
authorHarry Huang <huangxiangyu5@huawei.com>2019-02-02 08:15:05 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-02-02 08:15:05 +0000
commit5cb29909a1fa14e3f287f05d79c04b0c0152a214 (patch)
tree1a7402e6203091058c9e64a2ff025be5da7c0616 /deploy/client.py
parent8bf83904afd871206e029445dd8b881f6bcf9f66 (diff)
parente29a4ea1b77bdb9e78e2fabac8a3029c4c2b61fc (diff)
Merge "Adapt compass4nfv scripts to new compass-deck"
Diffstat (limited to 'deploy/client.py')
-rw-r--r--deploy/client.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/deploy/client.py b/deploy/client.py
index e612160b..3a9b0dec 100644
--- a/deploy/client.py
+++ b/deploy/client.py
@@ -79,8 +79,8 @@ opts = [
cfg.BoolOpt('poll_switches',
help='if the client polls switches',
default=True),
- cfg.StrOpt('machines',
- help='comma separated mac addresses of machines',
+ cfg.StrOpt('machine_file',
+ help='mac addresses and ipmi info of machines',
default=''),
cfg.StrOpt('subnets',
help='comma seperated subnets',
@@ -327,12 +327,12 @@ class CompassClient(object):
'get all machines status: %s, resp: %s', status, resp)
raise RuntimeError('failed to get machines')
- machines_to_add = list(set([
- machine for machine in CONF.machines.split(',')
- if machine
- ]))
+ with open(CONF.machine_file) as fd:
+ machines_to_add = [str(m["mac"]) for m in yaml.load(fd)]
+ resp = byteify(resp)
machines_db = [str(m["mac"]) for m in resp]
+
LOG.info(
'machines in db: %s\n to add: %s',
machines_db,
@@ -983,8 +983,6 @@ class CompassClient(object):
ansible_log = "%s/work/deploy/docker/ansible/run/%s-%s/ansible.log" \
% (compass_dir, CONF.adapter_name, CONF.cluster_name)
os.system("sudo touch %s" % ansible_log)
- os.system("sudo chmod +x -R %s/work/deploy/docker/ansible/run/"
- % compass_dir)
ansible_print = multiprocessing.Process(target=print_log,
args=(ansible_log,))
ansible_print.start()