Cannot add projects to VolumeType resource

Bug #1520270 reported by Peter Razumovsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Peter Razumovsky

Bug Description

I want private VolumeType resource with specified projects to access. I use next template:

heat_template_version: 2015-10-15

resources:
  vt:
    type: OS::Cinder::VolumeType
    properties:
      name: name
      is_public: False
      projects:
        - admin
        - demo

First case:
-----------

VolumeType fails during creating with next error: AttributeError: 'KeystoneClientV3' object has no attribute 'get_project_id'

Traceback:
2015-11-26 17:53:05.602 TRACE heat.engine.resource Traceback (most recent call last):
2015-11-26 17:53:05.602 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 633, in _action_recorder
2015-11-26 17:53:05.602 TRACE heat.engine.resource yield
2015-11-26 17:53:05.602 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 703, in _do_action
2015-11-26 17:53:05.602 TRACE heat.engine.resource yield self.action_handler_task(action, args=handler_args)
2015-11-26 17:53:05.602 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 295, in wrapper
2015-11-26 17:53:05.602 TRACE heat.engine.resource step = next(subtask)
2015-11-26 17:53:05.602 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 674, in action_handler_task
2015-11-26 17:53:05.602 TRACE heat.engine.resource handler_data = handler(*args)
2015-11-26 17:53:05.602 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/openstack/cinder/volume_type.py", line 99, in handle_create
2015-11-26 17:53:05.602 TRACE heat.engine.resource self._add_projects_access(self.properties[self.PROJECTS])
2015-11-26 17:53:05.602 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/openstack/cinder/volume_type.py", line 83, in _add_projects_access
2015-11-26 17:53:05.602 TRACE heat.engine.resource project_id = self.keystone().get_project_id(project)
2015-11-26 17:53:05.602 TRACE heat.engine.resource AttributeError: 'KeystoneClientV3' object has no attribute 'get_project_id'

Second case:
------------

Let take note, that some magic fixes first case issue. Now try to update volume type resource with another projects.

Update failed with error: TypeError: list indices must be integers, not str

Traceback:

2015-11-26 18:08:24.311 TRACE heat.engine.resource Traceback (most recent call last):
2015-11-26 18:08:24.311 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 633, in _action_recorder
2015-11-26 18:08:24.311 TRACE heat.engine.resource yield
2015-11-26 18:08:24.311 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 966, in update
2015-11-26 18:08:24.311 TRACE heat.engine.resource prop_diff])
2015-11-26 18:08:24.311 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/scheduler.py", line 295, in wrapper
2015-11-26 18:08:24.311 TRACE heat.engine.resource step = next(subtask)
2015-11-26 18:08:24.311 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 674, in action_handler_task
2015-11-26 18:08:24.311 TRACE heat.engine.resource handler_data = handler(*args)
2015-11-26 18:08:24.311 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/openstack/cinder/volume_type.py", line 125, in handle_update
2015-11-26 18:08:24.311 TRACE heat.engine.resource self.resource_id)['volume_type_access']
2015-11-26 18:08:24.311 TRACE heat.engine.resource TypeError: list indices must be integers, not str

Changed in heat:
importance: Undecided → High
milestone: none → mitaka-2
assignee: nobody → Peter Razumovsky (prazumovsky)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
status: New → In Progress
Changed in heat:
milestone: mitaka-2 → mitaka-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/250649
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=e6bd0bd5e9f773eeda976518e05ba09887d560f9
Submitter: Jenkins
Branch: master

commit e6bd0bd5e9f773eeda976518e05ba09887d560f9
Author: Peter Razumovsky <email address hidden>
Date: Fri Nov 27 10:25:30 2015 +0300

    Fix VolumeType projects property handling

    Currently using projects property in Cinder::VolumeType
    occurres many errors. This patch fixes incorrect using
    KeystoneClientPlugin method and handling of volume_type_access
    list response.

    Change-Id: Ib66766b33736911761cc0038be9764040fcf6f1f
    Closes-bug: #1520270

Changed in heat:
status: In Progress → Fix Committed
tags: added: liberty-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/251026

Changed in heat:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/liberty)

Reviewed: https://review.openstack.org/251026
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=01d002b302599a0c189344aef8254c0bd8fbc270
Submitter: Jenkins
Branch: stable/liberty

commit 01d002b302599a0c189344aef8254c0bd8fbc270
Author: Peter Razumovsky <email address hidden>
Date: Fri Nov 27 10:25:30 2015 +0300

    Fix VolumeType projects property handling

    Currently using projects property in Cinder::VolumeType
    occurres many errors. This patch fixes incorrect using
    KeystoneClientPlugin method and handling of volume_type_access
    list response.

    Change-Id: Ib66766b33736911761cc0038be9764040fcf6f1f
    Closes-bug: #1520270
    (cherry picked from commit e6bd0bd5e9f773eeda976518e05ba09887d560f9)

tags: added: in-stable-liberty
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.