← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2034035] [NEW] neutron allowed address pair with same ip address causes ValueError

 

Public bug reported:

when managing allowed address pairs in horizon for a neutron port and
you create two identical ip_address but with different mac_address,
horizon crashes because the id in the table is the same, see below
traceback.

solution is to concat mac_address if set in the ID for that row

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.6/site-packages/horizon/decorators.py", line 51, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/horizon/decorators.py", line 35, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/horizon/decorators.py", line 35, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/horizon/decorators.py", line 111, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/horizon/decorators.py", line 83, in dec
    return view_func(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/django/views/generic/base.py", line 98, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/horizon/tabs/views.py", line 156, in post
    return self.get(request, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/horizon/tabs/views.py", line 135, in get
    handled = self.handle_table(self._table_dict[table_name])
  File "/usr/lib/python3.6/site-packages/horizon/tabs/views.py", line 116, in handle_table
    handled = tab._tables[table_name].maybe_handle()
  File "/usr/lib/python3.6/site-packages/horizon/tables/base.py", line 1802, in maybe_handle
    return self.take_action(action_name, obj_id)
  File "/usr/lib/python3.6/site-packages/horizon/tables/base.py", line 1644, in take_action
    response = action.multiple(self, self.request, obj_ids)
  File "/usr/lib/python3.6/site-packages/horizon/tables/actions.py", line 305, in multiple
    return self.handle(data_table, request, object_ids)
  File "/usr/lib/python3.6/site-packages/horizon/tables/actions.py", line 760, in handle
    datum = table.get_object_by_id(datum_id)
  File "/usr/lib/python3.6/site-packages/horizon/tables/base.py", line 1480, in get_object_by_id
    % matches)
ValueError: Multiple matches were returned for that id: [<PortAllowedAddressPair: {'mac_address': 'fa:16:3e:9c:5d:cc', 'ip_address': '192.168.0.0/24'}>, <PortAllowedAddressPair: {'mac_address': 'fa:16:3e:e7:08:67', 'ip_address': '192.168.0.0/24'}>].

** Affects: horizon
     Importance: Undecided
         Status: In Progress

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/2034035

Title:
  neutron allowed address pair with same ip address causes ValueError

Status in OpenStack Dashboard (Horizon):
  In Progress

Bug description:
  when managing allowed address pairs in horizon for a neutron port and
  you create two identical ip_address but with different mac_address,
  horizon crashes because the id in the table is the same, see below
  traceback.

  solution is to concat mac_address if set in the ID for that row

  Traceback (most recent call last):
    File "/usr/lib/python3.6/site-packages/django/core/handlers/exception.py", line 47, in inner
      response = get_response(request)
    File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py", line 181, in _get_response
      response = wrapped_callback(request, *callback_args, **callback_kwargs)
    File "/usr/lib/python3.6/site-packages/horizon/decorators.py", line 51, in dec
      return view_func(request, *args, **kwargs)
    File "/usr/lib/python3.6/site-packages/horizon/decorators.py", line 35, in dec
      return view_func(request, *args, **kwargs)
    File "/usr/lib/python3.6/site-packages/horizon/decorators.py", line 35, in dec
      return view_func(request, *args, **kwargs)
    File "/usr/lib/python3.6/site-packages/horizon/decorators.py", line 111, in dec
      return view_func(request, *args, **kwargs)
    File "/usr/lib/python3.6/site-packages/horizon/decorators.py", line 83, in dec
      return view_func(request, *args, **kwargs)
    File "/usr/lib/python3.6/site-packages/django/views/generic/base.py", line 70, in view
      return self.dispatch(request, *args, **kwargs)
    File "/usr/lib/python3.6/site-packages/django/views/generic/base.py", line 98, in dispatch
      return handler(request, *args, **kwargs)
    File "/usr/lib/python3.6/site-packages/horizon/tabs/views.py", line 156, in post
      return self.get(request, *args, **kwargs)
    File "/usr/lib/python3.6/site-packages/horizon/tabs/views.py", line 135, in get
      handled = self.handle_table(self._table_dict[table_name])
    File "/usr/lib/python3.6/site-packages/horizon/tabs/views.py", line 116, in handle_table
      handled = tab._tables[table_name].maybe_handle()
    File "/usr/lib/python3.6/site-packages/horizon/tables/base.py", line 1802, in maybe_handle
      return self.take_action(action_name, obj_id)
    File "/usr/lib/python3.6/site-packages/horizon/tables/base.py", line 1644, in take_action
      response = action.multiple(self, self.request, obj_ids)
    File "/usr/lib/python3.6/site-packages/horizon/tables/actions.py", line 305, in multiple
      return self.handle(data_table, request, object_ids)
    File "/usr/lib/python3.6/site-packages/horizon/tables/actions.py", line 760, in handle
      datum = table.get_object_by_id(datum_id)
    File "/usr/lib/python3.6/site-packages/horizon/tables/base.py", line 1480, in get_object_by_id
      % matches)
  ValueError: Multiple matches were returned for that id: [<PortAllowedAddressPair: {'mac_address': 'fa:16:3e:9c:5d:cc', 'ip_address': '192.168.0.0/24'}>, <PortAllowedAddressPair: {'mac_address': 'fa:16:3e:e7:08:67', 'ip_address': '192.168.0.0/24'}>].

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



Follow ups