aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/rename_nics.py
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/rename_nics.py')
-rw-r--r--deploy/rename_nics.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/deploy/rename_nics.py b/deploy/rename_nics.py
index e9597595..2672c990 100644
--- a/deploy/rename_nics.py
+++ b/deploy/rename_nics.py
@@ -26,14 +26,12 @@ def rename_nics(dha_info, rsa_file, compass_ip, os_version):
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'" # noqa
- % (rsa_file, compass_ip, host_name, nic_name, mac)) # noqa
-
- exec_cmd("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
- -i %s root@%s \
- 'cobbler sync'" % (rsa_file, compass_ip))
+ exec_cmd("sudo docker exec compass-cobbler bash -c \
+ 'cobbler system edit --name=%s --interface=%s --mac=%s --static=1'" # noqa
+ % (host_name, nic_name, mac)) # noqa
+
+ exec_cmd("sudo docker exec compass-cobbler bash -c \
+ 'cobbler sync'")
if __name__ == "__main__":
assert(len(sys.argv) == 5)