Skip to content

Commit

Permalink
Add a new property to routing instance to indicate that it is a defau…
Browse files Browse the repository at this point in the history
…lt routing instance for the network

Change-Id: I7f36587045c0ad0257a8f3e63cef3fa28775c82d
Partial-Bug: 1380750
  • Loading branch information
Sachin Bansal authored and Sachin Bansal committed Nov 19, 2014
1 parent b41a0e4 commit 82ec615
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/config/schema-transformer/to_bgp.py
Expand Up @@ -553,6 +553,7 @@ def locate_routing_instance(self, rinst_name, service_chain=None):
if rinst_name in self.rinst:
return self.rinst[rinst_name]

is_default = (rinst_name == self._default_ri_name)
alloc_new = False
rinst_fq_name_str = '%s:%s' % (self.obj.get_fq_name_str(), rinst_name)
old_rtgt = None
Expand Down Expand Up @@ -586,12 +587,14 @@ def locate_routing_instance(self, rinst_name, service_chain=None):
rinst_obj = None
else:
rinst_obj.set_route_target(rtgt_obj, inst_tgt_data)
rinst_obj.set_routing_instance_is_default(is_default)
_vnc_lib.routing_instance_update(rinst_obj)
except NoIdError:
rinst_obj = None
if rinst_obj is None:
rinst_obj = RoutingInstance(rinst_name, self.obj)
rinst_obj.set_route_target(rtgt_obj, inst_tgt_data)
rinst_obj.set_routing_instance_is_default(is_default)
_vnc_lib.routing_instance_create(rinst_obj)
except HttpError as he:
_sandesh._logger.error(
Expand Down
4 changes: 4 additions & 0 deletions src/schema/bgp_schema.xsd
Expand Up @@ -139,6 +139,10 @@
<!-- #IFMAP-SEMANTICS-IDL
Property('service-chain-information', 'routing-instance') -->

<xsd:element name="routing-instance-is-default" type="xsd:boolean" default="false"/>
<!--#IFMAP-SEMANTICS-IDL
Property('routing-instance-is-default', 'routing-instance') -->

<xsd:complexType name="ServiceChainInfo">
<xsd:all>
<xsd:element name='routing-instance' type='xsd:string'/>
Expand Down

0 comments on commit 82ec615

Please sign in to comment.