extraneous vim editor configuration comments

Many of the source code files have a beginning line:
vim: tabstop=4 shiftwidth=4 softtabstop=4

This should be deleted.

Change-Id: I0b7bd4e727c0597e7c7fb61d42684e908e001134
Closes-Bug: #1229324
Merge "extraneous vim editor configuration comments"
Remove out-dated exceptions

There are some exceptions defined in exc module, which is introduced
two years ago, and it is marked as DEPRECATED in the same time. It
should be removed for now, since there are no longer used.

Change-Id: I039575f37b0e6d1c30e447b74d61b8cd0b6bbd29
fixed several pep8 issues

  * 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
Fix exception handling of CLI

Because exc.Unauthorized exception has been removed for commit
"Remove out-dated exceptions"(https://review.openstack.org/#/c/93852/).
but it still in use in ceilometerclient.shell.CeilometerShell#main().
This patch replace exc.Unauthorized with exc.HTTPUnauthorized.
And other three places of exc.NotFound are in use too.

Change-Id: I3e010db20cb6f6636126cceed5c62a9817213739
Closes-bug: #1321649
replace dict.iteritems() with six.iteritems(dict)

According to https://wiki.openstack.org/wiki/Python3 dict.iteritems()
should be replaced with six.iteritems(dict).

Change-Id: I52cc0e89c030d7b6bfc735239638b513410933c5
Avoid unnecessary stderr message when run test

Currently, if we run `tox -epy27`, we will get an useless stderr
message 'HTTPUnauthorized (HTTP 401)', which is triggered on purpose
by a test. It should be mocked because it provides no such useful message.

Change-Id: I009310257741a34fe966d6d745de3c6cf58e0feb
Closes-Bug: #1323480
Merge "fixed several pep8 issues"
use mock instead of try...finally

There are some test code use try...finally block to catch or ignore
the stdout message. The job can be done by mock too, and it is cleaner.

Change-Id: I0c29382e7bcd0b7f399565b26f27315f7e17a8fc
Refactor split_by_op and split_by_datatype

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
Merge "Avoid unnecessary stderr message when run test"
Merge "use mock instead of try...finally"
Merge "replace dict.iteritems() with six.iteritems(dict)"