Skip to content

Commit

Permalink
Check for route targets first to avoid early return from function
Browse files Browse the repository at this point in the history
While verifying the request during virtual network update, we were
returning from function if no network-ipam-refs were present in
the request. With that there was no check done for route targets.
We now check for route targets first to avoid that situation.

Change-Id: If8752ef338100208a9e44907d1ba3671d2417aa8
Closes-Bug: 1470616
  • Loading branch information
Sachin Bansal committed Jul 2, 2015
1 parent 2ec38ee commit 0d12cb3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/config/api-server/vnc_cfg_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,10 @@ def http_put(cls, id, fq_name, obj_dict, db_conn):
# Ignore ip-fabric subnet updates
return True, ""

(ok, error) = cls._check_route_targets(obj_dict, db_conn)
if not ok:
return (False, (400, error))

if 'network_ipam_refs' not in obj_dict:
# NOP for addr-mgmt module
return True, ""
Expand Down Expand Up @@ -566,9 +570,6 @@ def http_put(cls, id, fq_name, obj_dict, db_conn):
except Exception as e:
return (False, (500, str(e)))

(ok, error) = cls._check_route_targets(obj_dict, db_conn)
if not ok:
return (False, (400, error))
return True, ""
# end http_put

Expand Down

0 comments on commit 0d12cb3

Please sign in to comment.