summaryrefslogtreecommitdiff
path: root/ceilometerclient/common/base.py
Commit message (Collapse)AuthorAgeFilesLines
* remove py24 compatible codeZhiQiang Fan2016-01-081-7/+0
| | | | Change-Id: If62986b3ba913776ee6b9328a10e358e0e14e7cd
* Catch missing 404 exceptions in clientJuan Antonio Osorio Robles2015-05-181-1/+5
| | | | | | | | | | | | | | | | | Whenever an entity wasn't found, the ceilometerclient would issue a NotFound exception. Which is fine, except that it's not the exception that was being expected in the client at all. This exception was defined in the apiclient in the openstack/common directory. So, instead this exception is now being caught in the manager, and now the appropriate exception is being raised. There were some functions where, if the entity was not to be found, a 404 exception would be raised, which was never caught by the client since it was expecting the function to return None, instead of raising. This CR fixes that. Closes-Bug: #1451833 Change-Id: I47b34af2df9c85f86ba1f7f4d7b2951f8d27f96c
* Allow all pep8 checksDina Belova2015-01-121-5/+11
| | | | | | | Fix H405 pep8 issue. H904 issue check was ignored, although there were no places in client code violating this rule. Change-Id: If3b84eb8abb03511d7f77cabfa2955f472a60f23
* Add client property for common.base.ManagerZhiQiang Fan2014-12-191-0/+5
| | | | | | | | | | The latest oslo-incubator.apiclient code assumes resource manager has property named client, but ceilometerclient has named that property to api, which will cause problem when we sync with oslo-incubator. This patch simply uses client as an alias of api. Change-Id: I90c5ff10309ff7ad3fb634274e16c26ec8e6a1a2
* Verify alarm found before modifyingEric Pendergrass2014-08-291-1/+5
| | | | | | | | | | | | | | | | | | | Current behavior is to retrieve alarm by id and conduct operations on the object. If the tenant doesn't own the alarm or isn't admin, the user will receive the message: 'NoneType' object has no attribute 'to_dict' Above message doesn't provide any useful diagnostic information and indicates a programming error since an unexpected None-type is encountered and not handled. This change verifies the alarm is found before using the object. If alarm not found it prints the same message for a not found Alarm as other PUT operations like alarm-state-set: Alarm not found: <alarm_id>. This message is more useful for diagnosis and gets rid of the uncaught None-type error. Change-Id: I66abcd4498b24ac7cadcf29fe3ced3fcda08458c Closes-Bug: #1348387
* Use HTTPClient from common Oslo codeekudryashova2014-07-311-4/+4
| | | | | | | | | In the process of unification of the clients code we should reuse common functionality from Oslo. bp common-client-library-2 Change-Id: I0e027c33ee42b6de032d33269caeea33e7837f40
* Use Resource() class from common Oslo codeekudryashova2014-01-081-51/+2
| | | | | | | | In the process of unification of the clients code we should reuse common functionality from Oslo. Resource() class from ceilometer duplicates Oslo funclionality, so we replace it with inheritance Change-Id: I4e4b83252cdc87e8484d15e351cd5dab08f3ed8a
* Use six.iteritems() for dictKui Shi2013-10-141-1/+2
| | | | | | | | | Fix the error: AttributeError: 'dict' object has no attribute 'iteritems' Partial Implement: blueprint py33-support Change-Id: I5dff17d1df01d6583f882f818434804d65726c51
* Replace OpenStack LLC with OpenStack FoundationZhiQiang Fan2013-09-201-1/+1
| | | | | Change-Id: Ia007da282714d8ee7337fd3b51f6dcc3b64d7ec3 Fixes-Bug: #1214176
* Add client support for creating new alarms.Eoghan Glynn2013-05-281-3/+8
| | | | Change-Id: I4e3be2e480803eeaf4ec11079e69e7e6afd5e0d1
* Add client support for updating alarms.Eoghan Glynn2013-05-281-1/+1
| | | | Change-Id: I2a368f536ec440387d32a8076a86d143b94d7c90
* Fix pep H402 and H401 errorsAngus Salkeld2013-05-201-8/+5
| | | | | | This is an effort to get the pep ignores to be closer to nova. Change-Id: I451df579bbead00a8ff2c301c1a84e7c0a896002
* v2 API: added resource-show.Lianhao Lu2013-03-291-1/+4
| | | | | | | | Added resource-show command for v2 API. blueprint more-cli-cmd. Change-Id: I9e0dcff63b2ac6650094d47a947a2deaaea2ba4d
* Catch KeyError exception as early as possible when there is no matching data ↵Dan Florea2013-03-081-1/+4
| | | | | | | | | | | | | | | | | on the server. When the server does not have any data matching the requested response_key, it can still return successfully. A subsequent lookup in the returned data throws a KeyError exception. The simple fix for this is to catch the KeyError exception and return an empty list. An empty list, rather than None, is required because the calling code expects an iterable. The exception is caught as early as possible after the server returns from the GET request. The end result is that the CLI user sees an empty result when the requested data doesn't exist on the server. Prior to this fix the keyError exception was propagated all the way to the user, causing a confusing message to be printed. Also added associated unit test. Fixes bug #1111972 Change-Id: I88ba658f8be7e7edf255ef9f7d83ba87f36f4efc
* Add support for v2 APIJulien Danjou2013-02-181-2/+5
| | | | | Change-Id: I861e53db5446d2e3dc49935ea1cdd1607cff0a2a Signed-off-by: Julien Danjou <julien@danjou.info>
* Pin pep8 to 1.3.3Chuck Short2013-01-071-2/+2
| | | | | | | | pep8 1.3.3 is pretty much standard across the openstack projects. Pin pep8 1.3.3 and fix associated warnings/errors. Change-Id: I7230857889d261320a0dab2c261c9f85dc0ee602 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Add basic functionalityAngus Salkeld2012-11-091-0/+131
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>