Skip to content

Commit

Permalink
Return appropriate error message when route prefix cannot be parsed
Browse files Browse the repository at this point in the history
Change-Id: I5f518d661d916d7eff4b1857e7bd5a45e01f6094
Closes-Bug: 1609728
(cherry picked from commit f4466d7)
  • Loading branch information
Sachin Bansal committed Aug 5, 2016
1 parent 422ae27 commit b1abd77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/config/api-server/vnc_cfg_types.py
Expand Up @@ -1971,7 +1971,10 @@ def _check(cls, obj_dict, db_conn):
family = None
entries = obj_dict.get('aggregate_route_entries', {})
for route in entries.get('route', []):
route_family = IPNetwork(route).version
try:
route_family = IPNetwork(route).version
except TypeError:
return (False, (400, 'Invalid route: %s' % route))
if family and route_family != family:
return (False, (400, 'All prefixes in a route aggregate '
'object must be of same ip family'))
Expand Down

0 comments on commit b1abd77

Please sign in to comment.