diff options
author | meimei <meimei@huawei.com> | 2016-11-29 18:05:01 +0800 |
---|---|---|
committer | meimei <meimei@huawei.com> | 2016-11-29 18:09:16 +0800 |
commit | 6b2eccf0350f7f053e18ea2ac190489b00960809 (patch) | |
tree | 8968b2871c4bfc23bfa7077e857dae4d151e53d2 /deploy/setup_vnic.py | |
parent | fcd0eefae931bb7bed0380574c1c7acaa31ffa28 (diff) |
Improve compass ci verification, clear all the warnnings
JIRA: COMPASS-494
MODIFY BY HAOJINGBO
Change-Id: I2b95d84157c860254b3b3f68f7b2a54393caf8f4
Signed-off-by: meimei <meimei@huawei.com>
Diffstat (limited to 'deploy/setup_vnic.py')
-rw-r--r-- | deploy/setup_vnic.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/deploy/setup_vnic.py b/deploy/setup_vnic.py index 8e14765f..a8fd7b98 100644 --- a/deploy/setup_vnic.py +++ b/deploy/setup_vnic.py @@ -5,15 +5,21 @@ 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)) |