[Sahara] Copy node group template button doesn't work in some cases

Bug #1418278 reported by Andrew Lazarev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Andrew Lazarev

Bug Description

Copy node group template doesn't work if node group template contains None as "security_groups" field. Note, it is impossible to get into such state using horizon.

Steps to reproduce:
1. Create node group template with security_groups=None (default value) using REST API. Note, horizon puts [] for this field.
2. Open node group templates list in horizon
3. Click 'Copy Template' button

Observed behavior: 'Danger: An error occurred. Please try again later.' error

Stacktrace from horizon:
Internal Server Error: /project/data_processing/nodegroup_templates/1e560118-3281-49a3-abc7-9742a3fe8408/copy
Traceback (most recent call last):
  File "/Users/alazarev/openstack/horizon/.venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/alazarev/openstack/horizon/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/Users/alazarev/openstack/horizon/horizon/decorators.py", line 52, in dec
    return view_func(request, *args, **kwargs)
  File "/Users/alazarev/openstack/horizon/horizon/decorators.py", line 36, in dec
    return view_func(request, *args, **kwargs)
  File "/Users/alazarev/openstack/horizon/horizon/decorators.py", line 84, in dec
    return view_func(request, *args, **kwargs)
  File "/Users/alazarev/openstack/horizon/.venv/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)
  File "/Users/alazarev/openstack/horizon/.venv/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch
    return handler(request, *args, **kwargs)
  File "/Users/alazarev/openstack/horizon/horizon/workflows/views.py", line 144, in get
    context = self.get_context_data(**kwargs)
  File "/Users/alazarev/openstack/horizon/openstack_dashboard/dashboards/project/data_processing/nodegroup_templates/views.py", line 89, in get_context_data
    .get_context_data(**kwargs)
  File "/Users/alazarev/openstack/horizon/horizon/workflows/views.py", line 91, in get_context_data
    workflow = self.get_workflow()
  File "/Users/alazarev/openstack/horizon/horizon/workflows/views.py", line 81, in get_workflow
    entry_point=entry_point)
  File "/Users/alazarev/openstack/horizon/openstack_dashboard/dashboards/project/data_processing/nodegroup_templates/workflows/copy.py", line 71, in __init__
    [(sg, sg) for sg in template.security_groups])
TypeError: 'NoneType' object is not iterable

tags: added: sahara
Changed in horizon:
assignee: nobody → Andrew Lazarev (alazarev)
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/153105

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/153105
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=4da82b5acf7639e2b5e33739fa5de50ce55cfcb5
Submitter: Jenkins
Branch: master

commit 4da82b5acf7639e2b5e33739fa5de50ce55cfcb5
Author: Andrew Lazarev <email address hidden>
Date: Wed Feb 4 17:44:24 2015 -0800

    [Sahara] Fixed copy nodegroup template when sec groups missing

    'security_groups' is not required field. So, we should handle
    None value.

    Change-Id: I0233a0e247912f3f8f34f1c85e833eee4b1aa8f8
    Closes-Bug: #1418278

Changed in horizon:
status: In Progress → Fix Committed
tags: added: juno-backport-potential
Akihiro Motoki (amotoki)
Changed in horizon:
importance: Undecided → Medium
milestone: none → kilo-3
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-3 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.