summaryrefslogtreecommitdiffstats
path: root/deploy/rename_nics.py
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/rename_nics.py')
-rw-r--r--deploy/rename_nics.py11
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 \