Public bug reported:

Each neutron network has at least one segment.

While the network has only one segment, the 'segment' key is not added
to the info returned by API, but it is merged with a network,

Example:
(Pdb++) pp context.current
{'admin_state_up': True,
 'availability_zone_hints': [],
 'availability_zones': [],
 'created_at': '2020-03-25T09:04:26Z',
 'description': 'test',
 'dns_domain': '',
 'id': '7ec01be9-1bdc-409b-8bc7-047f337a9722',
 'ipv4_address_scope': None,
 'ipv6_address_scope': None,
 'is_default': True,
 'l2_adjacency': True,
 'mtu': 1500,
 'name': 'public',
 'port_security_enabled': True,
 'project_id': '5b69f4bc9cba4b1ab38f434785e27db8',
 'revision_number': 57,
 'router:external': True,
 'provider:network_type': 'flat',
 'provider:physical_network': 'public',
 'provider:segmentation_id': None,
 'shared': False,
 'status': 'ACTIVE',
 'subnets': ['40863f03-6b9a-4543-a9cb-ad122dfcde5d',
             'e5ae108b-a04b-4f23-84ff-e89db3222772'],
 'tags': [],
 'tenant_id': '5b69f4bc9cba4b1ab38f434785e27db8',
 'updated_at': '2020-03-25T13:55:38Z',
 'vlan_transparent': None}


When then network has more than one segment defined, then the network info 
looks as follows, the segment key is there:

(Pdb++) pp context.current
{'admin_state_up': True,
 'availability_zone_hints': [],
 'availability_zones': [],
 'created_at': '2020-03-25T09:04:26Z',
 'description': 'test',
 'dns_domain': '',
 'id': '7ec01be9-1bdc-409b-8bc7-047f337a9722',
 'ipv4_address_scope': None,
 'ipv6_address_scope': None,
 'is_default': True,
 'l2_adjacency': True,
 'mtu': 1500,
 'name': 'public',
 'port_security_enabled': True,
 'project_id': '5b69f4bc9cba4b1ab38f434785e27db8',
 'revision_number': 57,
 'router:external': True,
 'segments': [{'provider:network_type': 'flat',
               'provider:physical_network': 'public',
               'provider:segmentation_id': None},
              {'provider:network_type': 'flat',
               'provider:physical_network': 'public2',
               'provider:segmentation_id': None}],
 'shared': False,
 'status': 'ACTIVE',
 'subnets': ['40863f03-6b9a-4543-a9cb-ad122dfcde5d',
             'e5ae108b-a04b-4f23-84ff-e89db3222772'],
 'tags': [],
 'tenant_id': '5b69f4bc9cba4b1ab38f434785e27db8',
 'updated_at': '2020-03-25T13:55:38Z',
 'vlan_transparent': None}


We should make this behavior to be unique - add segments to the keys() in all 
cases.
The segments should also include each segment 'id' - it is required for OVN to 
setup localnet ports.

** Affects: neutron
     Importance: Undecided
         Status: Triaged

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1869877

Title:
  Segment doesn't exist network info

Status in neutron:
  Triaged

Bug description:
  Each neutron network has at least one segment.

  While the network has only one segment, the 'segment' key is not added
  to the info returned by API, but it is merged with a network,

  Example:
  (Pdb++) pp context.current
  {'admin_state_up': True,
   'availability_zone_hints': [],
   'availability_zones': [],
   'created_at': '2020-03-25T09:04:26Z',
   'description': 'test',
   'dns_domain': '',
   'id': '7ec01be9-1bdc-409b-8bc7-047f337a9722',
   'ipv4_address_scope': None,
   'ipv6_address_scope': None,
   'is_default': True,
   'l2_adjacency': True,
   'mtu': 1500,
   'name': 'public',
   'port_security_enabled': True,
   'project_id': '5b69f4bc9cba4b1ab38f434785e27db8',
   'revision_number': 57,
   'router:external': True,
   'provider:network_type': 'flat',
   'provider:physical_network': 'public',
   'provider:segmentation_id': None,
   'shared': False,
   'status': 'ACTIVE',
   'subnets': ['40863f03-6b9a-4543-a9cb-ad122dfcde5d',
               'e5ae108b-a04b-4f23-84ff-e89db3222772'],
   'tags': [],
   'tenant_id': '5b69f4bc9cba4b1ab38f434785e27db8',
   'updated_at': '2020-03-25T13:55:38Z',
   'vlan_transparent': None}

  
  When then network has more than one segment defined, then the network info 
looks as follows, the segment key is there:

  (Pdb++) pp context.current
  {'admin_state_up': True,
   'availability_zone_hints': [],
   'availability_zones': [],
   'created_at': '2020-03-25T09:04:26Z',
   'description': 'test',
   'dns_domain': '',
   'id': '7ec01be9-1bdc-409b-8bc7-047f337a9722',
   'ipv4_address_scope': None,
   'ipv6_address_scope': None,
   'is_default': True,
   'l2_adjacency': True,
   'mtu': 1500,
   'name': 'public',
   'port_security_enabled': True,
   'project_id': '5b69f4bc9cba4b1ab38f434785e27db8',
   'revision_number': 57,
   'router:external': True,
   'segments': [{'provider:network_type': 'flat',
                 'provider:physical_network': 'public',
                 'provider:segmentation_id': None},
                {'provider:network_type': 'flat',
                 'provider:physical_network': 'public2',
                 'provider:segmentation_id': None}],
   'shared': False,
   'status': 'ACTIVE',
   'subnets': ['40863f03-6b9a-4543-a9cb-ad122dfcde5d',
               'e5ae108b-a04b-4f23-84ff-e89db3222772'],
   'tags': [],
   'tenant_id': '5b69f4bc9cba4b1ab38f434785e27db8',
   'updated_at': '2020-03-25T13:55:38Z',
   'vlan_transparent': None}

  
  We should make this behavior to be unique - add segments to the keys() in all 
cases.
  The segments should also include each segment 'id' - it is required for OVN 
to setup localnet ports.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1869877/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to