diff options
author | 2016-11-29 18:05:01 +0800 | |
---|---|---|
committer | 2016-11-29 18:09:16 +0800 | |
commit | 6b2eccf0350f7f053e18ea2ac190489b00960809 (patch) | |
tree | 8968b2871c4bfc23bfa7077e857dae4d151e53d2 /deploy/adapters/ansible/roles/odl_cluster/files/recover_network_odl_l3.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/adapters/ansible/roles/odl_cluster/files/recover_network_odl_l3.py')
-rwxr-xr-x | deploy/adapters/ansible/roles/odl_cluster/files/recover_network_odl_l3.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/deploy/adapters/ansible/roles/odl_cluster/files/recover_network_odl_l3.py b/deploy/adapters/ansible/roles/odl_cluster/files/recover_network_odl_l3.py index 7bef1052..ec7f7c6b 100755 --- a/deploy/adapters/ansible/roles/odl_cluster/files/recover_network_odl_l3.py +++ b/deploy/adapters/ansible/roles/odl_cluster/files/recover_network_odl_l3.py @@ -6,25 +6,29 @@ import log as logging LOG = logging.getLogger("net-recover-odl-l3") config_path = os.path.join(os.path.dirname(__file__), "network.cfg") + def setup_bondings(bond_mappings): print bond_mappings + def setup_ips_new(config): LOG.info("setup_ips_new enter") network = netaddr.IPNetwork(config["ip_settings"]["br-prv"]["cidr"]) - intf_name = config["provider_net_mappings"][0]["interface"] cmd = "ip link set br-ex up;" cmd += "ip addr add %s/%s brd %s dev %s;" \ - % (config["ip_settings"]["br-prv"]["ip"], config["ip_settings"]["br-prv"]["netmask"], str(network.broadcast), 'br-ex') + % (config["ip_settings"]["br-prv"]["ip"], config["ip_settings"]["br-prv"]["netmask"], str(network.broadcast), 'br-ex') # noqa: E501 cmd += "route del default;" - cmd += "ip route add default via %s dev %s" % (config["ip_settings"]["br-prv"]["gw"], 'br-ex') + cmd += "ip route add default via %s dev %s" % ( + config["ip_settings"]["br-prv"]["gw"], 'br-ex') LOG.info("setup_ips_new: cmd=%s" % cmd) os.system(cmd) + def main(config): - setup_ips_new(config) + setup_ips_new(config) if __name__ == "__main__": - os.system("service openvswitch-switch status|| service openvswitch-switch start") + os.system( + "service openvswitch-switch status|| service openvswitch-switch start") config = yaml.load(open(config_path)) main(config) |