original_docstring: Add a GPE mapping to the router's loopback mac-address.
docstring: Add a GPE mapping to the router's loopback mac-address.
docstring_tokens: Add a GPE mapping to the router ' s loopback mac - address .
code: def add_remove_gpe_mappings(self, port_id, router_data, is_add=1):
          """Add a GPE mapping to the router's loopback mac-address."""
          if router_data.get('external_gateway_info', False):
              loopback_mac = self.data.vppf.router_external_interfaces[
                  port_id]['mac_address']
          else:
              loopback_mac = self.data.vppf.router_interfaces[
                  port_id]['mac_address']
          # GPE remote mappings are added for only the master L3 router,
          # if ha_enabled
          ha_enabled = cfg.CONF.ml2_vpp.enable_l3_ha
          if is_add:
              if (ha_enabled and self.data.vppf.router_state) or not ha_enabled:
                  self.data.gpe_listener.add_etcd_gpe_remote_mapping(
                      router_data['segmentation_id'],
                      loopback_mac,
                      router_data['gateway_ip'])
          else:
              self.data.gpe_listener.delete_etcd_gpe_remote_mapping(
                  router_data['segmentation_id'],
                  loopback_mac)
code_tokens: def add_remove_gpe_mappings ( self , port_id , router_data , is_add = 1 ) : if router_data . get ( 'external_gateway_info' , False ) : loopback_mac = self . data . vppf . router_external_interfaces [ port_id ] [ 'mac_address' ] else : loopback_mac = self . data . vppf . router_interfaces [ port_id ] [ 'mac_address' ] ha_enabled = cfg . CONF . ml2_vpp . enable_l3_ha if is_add : if ( ha_enabled and self . data . vppf . router_state ) or not ha_enabled : self . data . gpe_listener . add_etcd_gpe_remote_mapping ( router_data [ 'segmentation_id' ] , loopback_mac , router_data [ 'gateway_ip' ] ) else : self . data . gpe_listener . delete_etcd_gpe_remote_mapping ( router_data [ 'segmentation_id' ] , loopback_mac )
short_docstring: Add a GPE mapping to the router's loopback mac-address.
short_docstring_tokens: Add a GPE mapping to the router ' s loopback mac - address .
comment: """Add a GPE mapping to the router's loopback mac-address."""$SEP$# GPE remote mappings are added for only the master L3 router,$SEP$# if ha_enabled