Skip to content

Commit

Permalink
Set up resource class for route-aggregate
Browse files Browse the repository at this point in the history
Resource class for route aggregate objects wasn't set correctly.
As a result, any checks added to the class weren't being performed.
Also, there was a problem in the way _check function was being called.

Change-Id: I9622899cb793842b1c22d6a0f17d36bb29c94284
Closes-Bug: 1547973
Closes-Bug: 1547974
Closes-Bug: 1548082
  • Loading branch information
Sachin Bansal committed Feb 22, 2016
1 parent 26e68f9 commit d539bda
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/config/api-server/vnc_cfg_api_server.py
Expand Up @@ -1224,6 +1224,8 @@ def __init__(self, args_str=None):
# service appliance set
self.set_resource_class('service-appliance-set',
vnc_cfg_types.ServiceApplianceSetServer)
self.set_resource_class('route-aggregate',
vnc_cfg_types.RouteAggregateServer)
# TODO default-generation-setting can be from ini file
self.get_resource_class('bgp-router').generate_default_instance = False
self.get_resource_class(
Expand Down
5 changes: 3 additions & 2 deletions src/config/api-server/vnc_cfg_types.py
Expand Up @@ -1647,15 +1647,16 @@ def _check(cls, obj_dict, db_conn):
return (False, (400, 'All prefixes in a route aggregate '
'object must be of same ip family'))
family = route_family
return True, ""
# end _check

@classmethod
def pre_dbe_create(cls, tenant_name, obj_dict, db_conn):
return _check(cls, obj_dict, db_conn)
return cls._check(obj_dict, db_conn)

@classmethod
def pre_dbe_update(cls, id, fq_name, obj_dict, db_conn, **kwargs):
return _check(cls, obj_dict, db_conn)
return cls._check(obj_dict, db_conn)

# end class RouteAggregateServer

2 changes: 1 addition & 1 deletion src/config/schema-transformer/config_db.py
Expand Up @@ -3907,7 +3907,7 @@ def add_routing_instance(self, ri):
return
next_hop = ri.service_chain_info.get_service_chain_address()
elif ip_version == 6:
if ri.v6service_chain_info is None:
if ri.v6_service_chain_info is None:
self._logger.error("No ipv6 service chain info found for %s"
% ri.name)
return
Expand Down

0 comments on commit d539bda

Please sign in to comment.