summaryrefslogtreecommitdiffstats
path: root/deploy/rename_nics.py
diff options
context:
space:
mode:
authorJustin chi <chigang@huawei.com>2017-06-09 07:26:19 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-06-09 07:26:19 +0000
commitdcce2491af9015d6d903d784ae1c145f329ece43 (patch)
tree617c90be07cccce7407598d66398536999344116 /deploy/rename_nics.py
parent8ed47ae6ab2e57a37cd90707adcd0b2ea53362a1 (diff)
parentd635bd1f5762acd78545b650b2f55c112643b486 (diff)
Merge "support Containerized compass-core"
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)