summaryrefslogtreecommitdiffstats
path: root/deploy/setup_vnic.py
diff options
context:
space:
mode:
authorJustin chi <chigang@huawei.com>2016-11-11 02:15:30 +0000
committerGerrit Code Review <gerrit@opnfv.org>2016-11-11 02:15:30 +0000
commit17328cc3f88131cfdfb0fe0833336a583a191f97 (patch)
tree858fc8a56cfe0ce2e28e61dd8d56ef519ba8dcf9 /deploy/setup_vnic.py
parent9dc55a9dc191d61e35d34042afd310626cb32538 (diff)
parent404fcf8f737f405da7fd2e61441dd20a57d63935 (diff)
Merge "autopep8 make py files more standard"
Diffstat (limited to 'deploy/setup_vnic.py')
-rw-r--r--deploy/setup_vnic.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/deploy/setup_vnic.py b/deploy/setup_vnic.py
index 8e14765f..e7ab0cc0 100644
--- a/deploy/setup_vnic.py
+++ b/deploy/setup_vnic.py
@@ -5,15 +5,20 @@ import yaml
if __name__ == "__main__":
network_config_file = os.environ["NETWORK"]
network_config = yaml.load(open(network_config_file, "r"))
- os.system("sudo ovs-vsctl --may-exist add-port br-external mgmt_vnic -- set Interface mgmt_vnic type=internal")
+ os.system(
+ "sudo ovs-vsctl --may-exist add-port br-external mgmt_vnic -- set Interface mgmt_vnic type=internal")
os.system("sudo ip addr flush mgmt_vnic")
os.system("sudo ip link set mgmt_vnic up")
for sys_intf in network_config["sys_intf_mappings"]:
if sys_intf["name"] == "mgmt" and sys_intf.get("vlan_tag"):
- os.system("sudo ovs-vsctl set port mgmt_vnic tag=%s" % sys_intf["vlan_tag"])
+ os.system(
+ "sudo ovs-vsctl set port mgmt_vnic tag=%s" %
+ sys_intf["vlan_tag"])
for net_info in network_config["ip_settings"]:
if net_info["name"] == "mgmt":
- mgmt_ip_range_end= net_info["ip_ranges"][0][1]
+ mgmt_ip_range_end = net_info["ip_ranges"][0][1]
mgmt_netmask = net_info["cidr"].split('/')[1]
- os.system(r"sudo ip addr add %s/%s dev mgmt_vnic" % (mgmt_ip_range_end, mgmt_netmask))
+ os.system(
+ r"sudo ip addr add %s/%s dev mgmt_vnic" %
+ (mgmt_ip_range_end, mgmt_netmask))