summaryrefslogtreecommitdiff
path: root/ceilometerclient/v2/options.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Allow all pep8 checks"Jenkins2015-01-201-19/+19
|\
| * Allow all pep8 checksDina Belova2015-01-121-19/+19
| | | | | | | | | | | | | | Fix H405 pep8 issue. H904 issue check was ignored, although there were no places in client code violating this rule. Change-Id: If3b84eb8abb03511d7f77cabfa2955f472a60f23
* | Remove redundant parentheses (except openstack.common)Dina Belova2014-12-101-1/+1
|/ | | | Change-Id: I594234648a37d283559a0365969a7fe3609079f8
* Fix hacking rules: H302,H305,H307,H402ZhiQiang Fan2014-06-111-2/+2
| | | | | | | | | | Currently, OpenStack Proposal Bot tries to update requirements with global requirements, while the upgraded hacking has introduced some new rules which are not fully handled by current code. This patch fixes some simple rules which are quite straight-forward. Change-Id: If8334f69fb1ad34fbbd6ad898e0e92eb3f81e95a
* Refactor split_by_op and split_by_datatypeChris Dent2014-06-021-32/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | split_by_op was returning data against which further error checking was then required. This change moves that error handling inside the method and simplifies the regular expression so that it splits (greedily) on the first operator it finds. If the split is not possible, it is a ValueError. If the field or value are empty, that is a ValueError. Both split_by_op and split_by_datatype were doing a findall() where a match() and split() do the right job and more efficiently. Regular expression compilation has been moved to the module level to insure they need only be compiled once. Operator keys must be sorted by length to ensure the point at which the split happens is most greedy. Using a split keeps the regex short and removes any statements about the left and right hand sides of the operator. Tests added to cover the method more completely, including testing for corner cases such as single character field or values or operators showing up in unexpected locations. 'string' variable renamed to 'query' and 'query_value' to avoid confusion. Named parameters on string substitution for clarity. Note that the tests which do self.assertRaises could more explicitly check the exception with self.assertRaisesRegexp but that would break compatibility with Python 2.6. Change-Id: Icd815ff65aba9eae3f76afee3bb33e85d85bea72 Closes-Bug: #1314544
* fixed several pep8 issuesChristian Berendt2014-05-161-1/+1
| | | | | | | | | | | * E122 continuation line missing indentation or outdented * E126 continuation line over-indented for hanging indent * E128 continuation line under-indented for visual indent * E265 block comment should start with '# ' Tested with pep8 version 1.5.6 (2014-04-14). Change-Id: Iaea72c74d3678061b0ac837eb8fe8c85a883bb4a
* Update v2.options docstringZhiQiang Fan2014-04-151-5/+9
| | | | | | | | | | We already support 'type' attribute for query, but the docstring for build_url and cli_to_array don't refer to it. And the urlencode with doseq=True will force filter parameters grouped by name, so the sample in build_url docstring should be corrected too. Change-Id: I2b526d9e23175b5378ea36e0a532052269c7f0c4
* py3kcompat: remove in python-ceilometerclientJia Dong2014-02-211-2/+3
| | | | | | | | | Everything is already in six>=1.4.0 and we already depend on such a version. There's no reason to keep this file. So remove py3kcompat from python-ceilometerclient. Change-Id: Ide6876e7a60377cb3843816d1d9ab2c589bc8f1b Closes-Bug: #1280033
* Fix typos picked up by misspellingsZhiQiang Fan2014-01-231-1/+1
| | | | | | | | | | | Joe Gordon has introduced a module named misspellings which can check typo automatically. $ pip install misspellings $ git ls-files | grep -v locale | misspellings -f - Change-Id: I9eca2e097b03468651814fa563e4380fd573205e ref: http://lists.openstack.org/pipermail/openstack-dev/2013-December/020975.html
* Support the Event APIJohn Herndon2014-01-101-5/+25
| | | | | | | | | | | | This patch adds support for the currently available Event API, including events, event types, and traits. Add an optional data type to the query, ex: ceilometer list-events -q 'hostname=string::localhost" bp extend-client-operations Change-Id: Icea9bd67f8ee4ff2bf9da9ff6894218689580eb3
* align the order of parameters for urlencode()Kui Shi2013-10-151-1/+4
| | | | | | | | | | | | | | | | | In Python 3.3, hash randomization is enabled by default. It causes the iteration order of dicts and sets to be unpredictable and differ across Python runs. In the test case, the fixed expecting string will not match the test result, it is relying on the dict order. This change transforms the input dict to a sequence of two-element list, with fixed order, and update the related expecitng string / fixture in test cases. Partial Implement: blueprint py33-support Change-Id: I6dccde9e584be8335a6375f5fbad5c5cbd7b9b6d
* Import urlutils to substitute urllibKui Shi2013-10-141-2/+2
| | | | | | | | Use the openstack common urlutils. Partial Implement: blueprint py33-support Change-Id: I45f21d7316fe87952e841004d4c25999138a842b
* Enhance ceilometer statistics command with --periodGuangyu Suo2013-07-231-1/+4
| | | | | | | | | Currently, if don't specify query parameter in ceilometer statistics command, ceilometer statistics with --period will not work. This change is trying to fix this issue. Change-Id: I8723bad11d5c452c2834e33df9bb01ebdc6ce9ce Fixs: bug #1202658
* Add support for specifying statistics period.Eoghan Glynn2013-06-201-4/+11
| | | | | | | Allow the period to be be specified as an addition parameter when retrieving statistics. Change-Id: Ied3add404fb8b20c46a4de00f07273a6d6c4ffce
* Fix pep H402 and H401 errorsAngus Salkeld2013-05-201-5/+2
| | | | | | This is an effort to get the pep ignores to be closer to nova. Change-Id: I451df579bbead00a8ff2c301c1a84e7c0a896002
* Make it possible to pass -q "metadata.field=value"1.0.0Angus Salkeld2013-03-271-4/+6
| | | | | | | Currently the regex doesn't account for the "." Change-Id: Ia01bb3e2a79e54fd01b0b6fa5437827694d4fb96 Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
* Add resources and meters to the v2 shellAngus Salkeld2013-02-271-0/+83
This also moves the build_url function to a common file. Change-Id: Ia94f9fa37c83fc756a395a918ad254111951f67b Signed-off-by: Angus Salkeld <asalkeld@redhat.com>