Resource classes of managers should have methods like delete() and get()

Bug #1312146 reported by Arthur Svechnikov
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-ceilometerclient
Fix Released
High
Arthur Svechnikov

Bug Description

The resource classes of managers should have methods like delete() and get(), perhaps some additional methods for specific classes. For example scenario tests use basic methods delete and get, while doing cleanup.

Traceback (most recent call last):
  File "/opt/stack/tempest/tempest/scenario/test_threshold_alarm.py", line 42, in cleanup_wrapper
    self.cleanup_resource(resource, self.__class__.__name__)
  File "/opt/stack/tempest/tempest/scenario/manager.py", line 117, in cleanup_resource
    resource.delete()
  File "/opt/stack/python-ceilometerclient/ceilometerclient/v2/alarms.py", line 52, in __getattr__
    return super(Alarm, self).__getattr__(k)
  File "/opt/stack/python-ceilometerclient/ceilometerclient/openstack/common/apiclient/base.py", line 460, in __getattr__
    self.get()
  File "/opt/stack/python-ceilometerclient/ceilometerclient/openstack/common/apiclient/base.py", line 473, in get
    new = self.manager.get(self.id)
  File "/opt/stack/python-ceilometerclient/ceilometerclient/v2/alarms.py", line 52, in __getattr__
    return super(Alarm, self).__getattr__(k)
  File "/opt/stack/python-ceilometerclient/ceilometerclient/openstack/common/apiclient/base.py", line 463, in __getattr__
    raise AttributeError(k)
AttributeError: id

Changed in python-ceilometerclient:
assignee: nobody → Svechnikov Artur (asvechnikov)
Changed in python-ceilometerclient:
status: New → Triaged
importance: Undecided → High
Changed in python-ceilometerclient:
status: Triaged → In Progress
Revision history for this message
Arthur Svechnikov (asvechnikov) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-ceilometerclient (master)

Reviewed: https://review.openstack.org/91554
Committed: https://git.openstack.org/cgit/openstack/python-ceilometerclient/commit/?id=b8a3fe54c06c7e04314d39da80b5964a589356f0
Submitter: Jenkins
Branch: master

commit b8a3fe54c06c7e04314d39da80b5964a589356f0
Author: Artur Svechnikov <email address hidden>
Date: Thu May 1 17:00:26 2014 +0400

    Add methods to resource classes

    Resource classes of managers should have methods
    like delete() and get(). Basicly base.Resource
    class has method get(), which uses id attribute,
    but classes Alarm, Event, etc. have no this attribute.
    Added intercept getting of id in the resource classes.
    Also added catch of HTTPNotFound for alarm get()
    because it affects correct functionality of
    scenario tests.

    Closes-Bug: #1312146
    Change-Id: Ie598b73c64dece2185955467936dc6544a8a3dc7

Changed in python-ceilometerclient:
status: In Progress → Fix Committed
Changed in python-ceilometerclient:
milestone: none → 1.3.0
status: Fix Committed → Fix Released
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.