summaryrefslogtreecommitdiff
path: root/ceilometerclient/common
diff options
context:
space:
mode:
authorZhiQiang Fan <zhiqiang.fan@huawei.com>2014-06-11 16:32:20 +0800
committerZhiQiang Fan <zhiqiang.fan@huawei.com>2014-06-11 17:32:16 +0800
commit55227d6d32deb49b9a8728d217eece9d4ecfeedc (patch)
treee2850b394f38afa23ba48a2dcac428d78686aa7b /ceilometerclient/common
parenta69e5866f8b9762c3908429e615dd59948892545 (diff)
downloadpython-ceilometerclient-55227d6d32deb49b9a8728d217eece9d4ecfeedc.tar.gz
Fix hacking rules: H302,H305,H307,H402
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
Diffstat (limited to 'ceilometerclient/common')
-rw-r--r--ceilometerclient/common/http.py8
-rw-r--r--ceilometerclient/common/utils.py3
2 files changed, 6 insertions, 5 deletions
diff --git a/ceilometerclient/common/http.py b/ceilometerclient/common/http.py
index d83745b..f440abe 100644
--- a/ceilometerclient/common/http.py
+++ b/ceilometerclient/common/http.py
@@ -31,7 +31,7 @@ except ImportError:
import six
from six.moves import http_client as httplib # noqa
-from six.moves.urllib import parse
+from six.moves import urllib
from ceilometerclient import exc
@@ -51,7 +51,7 @@ class HTTPClient(object):
@staticmethod
def get_connection_params(endpoint, **kwargs):
- parts = parse.urlparse(endpoint)
+ parts = urllib.parse.urlparse(endpoint)
_args = (parts.hostname, parts.port, parts.path)
_kwargs = {'timeout': (float(kwargs.get('timeout'))
@@ -75,7 +75,7 @@ class HTTPClient(object):
_class = self.connection_params[0]
try:
if self.proxy_url:
- proxy_parts = parse.urlparse(self.proxy_url)
+ proxy_parts = urllib.parse.urlparse(self.proxy_url)
return _class(proxy_parts.hostname, proxy_parts.port,
**self.connection_params[2])
else:
@@ -212,7 +212,7 @@ class HTTPClient(object):
return self._http_request(url, method, **kwargs)
def get_proxy_url(self):
- scheme = parse.urlparse(self.endpoint).scheme
+ scheme = urllib.parse.urlparse(self.endpoint).scheme
if scheme == 'https':
return os.environ.get('https_proxy')
elif scheme == 'http':
diff --git a/ceilometerclient/common/utils.py b/ceilometerclient/common/utils.py
index 658cf7b..a6682f9 100644
--- a/ceilometerclient/common/utils.py
+++ b/ceilometerclient/common/utils.py
@@ -14,12 +14,13 @@
# under the License.
from __future__ import print_function
-import six
+
import sys
import textwrap
import uuid
import prettytable
+import six
from ceilometerclient import exc
from ceilometerclient.openstack.common import cliutils