original_docstring: Add neutron config to context.
  
      :param ctxt: Context dictionary
      :type ctxt: dict
      :param keystone_session: keystoneauth1.session.Session object
      :type: keystoneauth1.session.Session
      :returns: None
      :rtype: None
      
docstring: Add neutron config to context.
docstring_tokens: Add neutron config to context .
code: def add_neutron_config(ctxt, keystone_session):
      """Add neutron config to context.
  
      :param ctxt: Context dictionary
      :type ctxt: dict
      :param keystone_session: keystoneauth1.session.Session object
      :type: keystoneauth1.session.Session
      :returns: None
      :rtype: None
      """
      current_release = openstack_utils.get_os_release()
      focal_ussuri = openstack_utils.get_os_release('focal_ussuri')
      neutron_client = openstack_utils.get_neutron_session_client(
          keystone_session)
      net = neutron_client.find_resource("network", "ext_net")
      ctxt['ext_net'] = net['id']
      router = neutron_client.find_resource("router", "provider-router")
      ctxt['provider_router_id'] = router['id']
      # For focal+ with OVN, we use the same settings as upstream gate.
      # This is because the l3_agent_scheduler extension is only
      # applicable for OVN when conventional layer-3 agent enabled:
      # https://docs.openstack.org/networking-ovn/2.0.1/features.html
      # This enables test_list_show_extensions to run successfully.
      if current_release >= focal_ussuri:
          extensions = ('address-scope,agent,allowed-address-pairs,'
                        'auto-allocated-topology,availability_zone,'
                        'binding,default-subnetpools,external-net,'
                        'extra_dhcp_opt,multi-provider,net-mtu,'
                        'network_availability_zone,network-ip-availability,'
                        'port-security,provider,quotas,rbac-address-scope,'
                        'rbac-policies,standard-attr-revisions,security-group,'
                        'standard-attr-description,subnet_allocation,'
                        'standard-attr-tag,standard-attr-timestamp,trunk,'
                        'quota_details,router,extraroute,ext-gw-mode,'
                        'fip-port-details,pagination,sorting,project-id,'
                        'dns-integration,qos')
          ctxt['neutron_api_extensions'] = extensions
      else:
          ctxt['neutron_api_extensions'] = 'all'
code_tokens: def add_neutron_config ( ctxt , keystone_session ) : current_release = openstack_utils . get_os_release ( ) focal_ussuri = openstack_utils . get_os_release ( 'focal_ussuri' ) neutron_client = openstack_utils . get_neutron_session_client ( keystone_session ) net = neutron_client . find_resource ( "network" , "ext_net" ) ctxt [ 'ext_net' ] = net [ 'id' ] router = neutron_client . find_resource ( "router" , "provider-router" ) ctxt [ 'provider_router_id' ] = router [ 'id' ] if current_release >= focal_ussuri : extensions = ( 'address-scope,agent,allowed-address-pairs,' 'auto-allocated-topology,availability_zone,' 'binding,default-subnetpools,external-net,' 'extra_dhcp_opt,multi-provider,net-mtu,' 'network_availability_zone,network-ip-availability,' 'port-security,provider,quotas,rbac-address-scope,' 'rbac-policies,standard-attr-revisions,security-group,' 'standard-attr-description,subnet_allocation,' 'standard-attr-tag,standard-attr-timestamp,trunk,' 'quota_details,router,extraroute,ext-gw-mode,' 'fip-port-details,pagination,sorting,project-id,' 'dns-integration,qos' ) ctxt [ 'neutron_api_extensions' ] = extensions else : ctxt [ 'neutron_api_extensions' ] = 'all'
short_docstring: Add neutron config to context.
short_docstring_tokens: Add neutron config to context .
comment: """Add neutron config to context.
  
      :param ctxt: Context dictionary
      :type ctxt: dict
      :param keystone_session: keystoneauth1.session.Session object
      :type: keystoneauth1.session.Session
      :returns: None
      :rtype: None
      """$SEP$# For focal+ with OVN, we use the same settings as upstream gate.$SEP$# This is because the l3_agent_scheduler extension is only$SEP$# applicable for OVN when conventional layer-3 agent enabled:$SEP$# https://docs.openstack.org/networking-ovn/2.0.1/features.html$SEP$# This enables test_list_show_extensions to run successfully.