From b355a78fa71d68d24e7adced9025766cd5baf74a Mon Sep 17 00:00:00 2001 From: Philip Joseph Date: Thu, 9 Mar 2017 10:22:31 +0000 Subject: [PATCH] Bug 226 : Error instantiating NS Signed-off-by: Philip Joseph --- BUILD.sh | 2 +- .../rift/rwcal/openstack/utils/network.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/BUILD.sh b/BUILD.sh index ad779035..0e7804c4 100755 --- a/BUILD.sh +++ b/BUILD.sh @@ -189,7 +189,7 @@ if [[ $PLATFORM == ub16 ]]; then # this package is obsolete. OLD_PACKAGES="rw.core.rwvx-rwha-1.0" for package in $PACKAGES $OLD_PACKAGES; do - apt remove -y $package || true + sudo apt remove -y $package || true done packages="" diff --git a/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/utils/network.py b/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/utils/network.py index b0c58af2..8e5107bf 100644 --- a/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/utils/network.py +++ b/rwcal/plugins/vala/rwcal_openstack/rift/rwcal/openstack/utils/network.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# +# # Copyright 2017 RIFT.IO Inc # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -155,8 +155,11 @@ class NetworkUtils(object): else: raise NotImplementedError("Port Type: %s not supported" %(cp.type_yang)) - if cp.static_ip_address: - args["fixed_ips"] = [{"ip_address" : cp.static_ip_address}] + try: + if cp.static_ip_address: + args["fixed_ips"] = [{"ip_address" : cp.static_ip_address}] + except Exception as e: + pass if 'port_security_enabled' in cp: args['port_security_enabled'] = cp.port_security_enabled -- 2.17.1