diff options
Diffstat (limited to 'deploy/rename_nics.py')
-rw-r--r-- | deploy/rename_nics.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/deploy/rename_nics.py b/deploy/rename_nics.py index e9597595..f78b3979 100644 --- a/deploy/rename_nics.py +++ b/deploy/rename_nics.py @@ -26,19 +26,17 @@ 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("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("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 sync'") if __name__ == "__main__": assert(len(sys.argv) == 5) rename_nics( - yaml.load( + yaml.safe_load( open( sys.argv[1])), sys.argv[2], |