summaryrefslogtreecommitdiffstats
path: root/node-admin/scripts
diff options
context:
space:
mode:
authorOyvind Bakksjo <bakksjo@yahoo-inc.com>2016-06-24 14:35:04 +0200
committerOyvind Bakksjo <bakksjo@yahoo-inc.com>2016-06-27 12:44:11 +0200
commit6ffc3165b1ffca828240f74a87408bd20cd676e1 (patch)
treeb24acd79d36cc78c0b50ba053afbc99e13cf5cfa /node-admin/scripts
parentbaa79c174f301a28d50865961fc4d5ee82868c29 (diff)
Some simplification of code setting container gateway.
Diffstat (limited to 'node-admin/scripts')
-rwxr-xr-xnode-admin/scripts/configure-container-networking.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/node-admin/scripts/configure-container-networking.py b/node-admin/scripts/configure-container-networking.py
index b23fcf70ebc..51f691a4c87 100755
--- a/node-admin/scripts/configure-container-networking.py
+++ b/node-admin/scripts/configure-container-networking.py
@@ -340,9 +340,8 @@ else:
host_default_route = get_default_route(net_namespace=host_ns)
host_default_route_device_index = get_attribute(host_default_route, 'RTA_OIF')
- host_default_route_gateway = get_attribute(host_default_route, 'RTA_GATEWAY')
if host_device_index_for_container != host_default_route_device_index:
raise RuntimeError("Container's ip address is not on the same network as the host's default route."
" Could not set up default route for the container.")
- container_gateway = host_default_route_gateway
- container_ns.route("replace", gateway=container_gateway, index=container_interface_index)
+ host_default_route_gateway = get_attribute(host_default_route, 'RTA_GATEWAY')
+ container_ns.route("replace", gateway=host_default_route_gateway, index=container_interface_index)