Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential "list index out of range" in case no IP is assigned #10

Open
jbemmel opened this issue May 27, 2020 · 1 comment
Open

Potential "list index out of range" in case no IP is assigned #10

jbemmel opened this issue May 27, 2020 · 1 comment

Comments

@jbemmel
Copy link

jbemmel commented May 27, 2020

subnet_id = port['fixed_ips'][0]['subnet_id']

2020-05-27 17:38:24.178 54 CRITICAL nuage_neutron.plugins.sriov.trunk_driver [req-d143dc8f-25cf-4940-b0f3-3e631287047f 1885d187645f46c38f5cec0078052ea1 83b31028592b48169af26bc7f6820baa - default default] list index out of range: IndexError: list index out of range
2020-05-27 17:38:24.178 54 ERROR nuage_neutron.plugins.sriov.trunk_driver Traceback (most recent call last):
2020-05-27 17:38:24.178 54 ERROR nuage_neutron.plugins.sriov.trunk_driver File "/usr/lib/python2.7/site-packages/nuage_neutron/plugins/sriov/trunk_driver.py", line 375, in trunk_event
2020-05-27 17:38:24.178 54 ERROR nuage_neutron.plugins.sriov.trunk_driver self.trunk_pre_create(payload.context, payload.current_trunk)
2020-05-27 17:38:24.178 54 ERROR nuage_neutron.plugins.sriov.trunk_driver File "/usr/lib/python2.7/site-packages/nuage_neutron/plugins/sriov/trunk_driver.py", line 352, in trunk_pre_create
2020-05-27 17:38:24.178 54 ERROR nuage_neutron.plugins.sriov.trunk_driver self.subports_pre_create(context, trunk, trunk.sub_ports)
2020-05-27 17:38:24.178 54 ERROR nuage_neutron.plugins.sriov.trunk_driver File "/usr/lib/python2.7/site-packages/nuage_neutron/plugins/sriov/trunk_driver.py", line 345, in subports_pre_create
2020-05-27 17:38:24.178 54 ERROR nuage_neutron.plugins.sriov.trunk_driver trunk_subports = self._validate_subports_vlan(context, trunk)
2020-05-27 17:38:24.178 54 ERROR nuage_neutron.plugins.sriov.trunk_driver File "/usr/lib/python2.7/site-packages/nuage_neutron/plugins/sriov/trunk_driver.py", line 173, in _validate_subports_vlan
2020-05-27 17:38:24.178 54 ERROR nuage_neutron.plugins.sriov.trunk_driver subnet_id = port['fixed_ips'][0]['subnet_id']
2020-05-27 17:38:24.178 54 ERROR nuage_neutron.plugins.sriov.trunk_driver IndexError: list index out of range
2020-05-27 17:38:24.178 54 ERROR nuage_neutron.plugins.sriov.trunk_driver

@jbemmel
Copy link
Author

jbemmel commented May 27, 2020

Happens when a trunk subport is created through Heat:

port1_vlan1_subport:

            type: OS::Neutron::Port

            properties:

              # name: port1-sub1

              network_id: { get_resource: vlan1_network }

              replacement_policy: "AUTO"

              binding:vnic_type: "direct" # Must be same as parent

              port_security_enabled: {{ checkbox(0) }}

              # NOTE Reuse parent port's MAC address on all subports.

              mac_address: { get_attr: [port1_parent_port, mac_address] }

In this case, the 'ip_allocation' property ends up as 'deferred' (as there was no 'allocation_pools' defined for the network/subnet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant