diff options
author | meimei <meimei@huawei.com> | 2016-11-29 18:05:01 +0800 |
---|---|---|
committer | meimei <meimei@huawei.com> | 2016-11-29 18:09:16 +0800 |
commit | 6b2eccf0350f7f053e18ea2ac190489b00960809 (patch) | |
tree | 8968b2871c4bfc23bfa7077e857dae4d151e53d2 /deploy/rename_nics.py | |
parent | fcd0eefae931bb7bed0380574c1c7acaa31ffa28 (diff) |
Improve compass ci verification, clear all the warnnings
JIRA: COMPASS-494
MODIFY BY HAOJINGBO
Change-Id: I2b95d84157c860254b3b3f68f7b2a54393caf8f4
Signed-off-by: meimei <meimei@huawei.com>
Diffstat (limited to 'deploy/rename_nics.py')
-rw-r--r-- | deploy/rename_nics.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/deploy/rename_nics.py b/deploy/rename_nics.py index a95d1e02..482df355 100644 --- a/deploy/rename_nics.py +++ b/deploy/rename_nics.py @@ -2,10 +2,12 @@ import os import sys import yaml + def exec_cmd(cmd): print cmd os.system(cmd) + def rename_nics(dha_info, rsa_file, compass_ip): for host in dha_info['hosts']: host_name = host['name'] @@ -15,10 +17,11 @@ def rename_nics(dha_info, rsa_file, compass_ip): nic_name = interface.keys()[0] mac = interface.values()[0] - exec_cmd("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ - -i %s root@%s \ - 'cobbler system edit --name=%s --interface=%s --mac=%s --static=1'" \ - % (rsa_file, compass_ip, host_name, nic_name, mac)) + exec_cmd("ssh -o StrictHostKeyChecking=no -o \ + UserKnownHostsFile=/dev/null -i %s root@%s \ + 'cobbler system edit --name=%s --interface=%s \ + --mac=%s --static=1'" + % (rsa_file, compass_ip, host_name, nic_name, mac)) exec_cmd("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ -i %s root@%s \ |