From a615882802f861ec7cc1fd0ce6c26510f22191fe Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Thu, 17 Jan 2013 18:06:53 -0500 Subject: [PATCH] Fix hacking N302 import only modules * Includes some general tools/hacking cleanup * Fix several N302 cases * Disable N302 until all cases are fixed Change-Id: Iddba07ff13e10dc41a6930749044bb8c0572d279 --- bin/nova-novncproxy | 5 +++-- bin/nova-spicehtml5proxy | 5 +++-- nova/tests/test_api.py | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bin/nova-novncproxy b/bin/nova-novncproxy index 477510b9..7ddd2b26 100755 --- a/bin/nova-novncproxy +++ b/bin/nova-novncproxy @@ -25,7 +25,7 @@ import os import sys from nova import config -from nova.console import websocketproxy as ws +from nova import console from nova.openstack.common import cfg @@ -77,7 +77,8 @@ if __name__ == '__main__': sys.exit(-1) # Create and start the NovaWebSockets proxy - server = ws.NovaWebSocketProxy(listen_host=CONF.novncproxy_host, + server = console.websocketproxy.NovaWebSocketProxy( + listen_host=CONF.novncproxy_host, listen_port=CONF.novncproxy_port, source_is_ipv6=CONF.source_is_ipv6, verbose=CONF.verbose, diff --git a/bin/nova-spicehtml5proxy b/bin/nova-spicehtml5proxy index 089ff9d7..161ccee7 100755 --- a/bin/nova-spicehtml5proxy +++ b/bin/nova-spicehtml5proxy @@ -25,7 +25,7 @@ import os import sys from nova import config -from nova.console import websocketproxy as ws +from nova import console from nova.openstack.common import cfg @@ -77,7 +77,8 @@ if __name__ == '__main__': sys.exit(-1) # Create and start the NovaWebSockets proxy - server = ws.NovaWebSocketProxy(listen_host=CONF.spicehtml5proxy_host, + server = console.websocketproxy.NovaWebSocketProxy( + listen_host=CONF.spicehtml5proxy_host, listen_port=CONF.spicehtml5proxy_port, source_is_ipv6=CONF.source_is_ipv6, verbose=CONF.verbose, diff --git a/nova/tests/test_api.py b/nova/tests/test_api.py index fb2e76e4..11c16d6d 100644 --- a/nova/tests/test_api.py +++ b/nova/tests/test_api.py @@ -26,9 +26,9 @@ from boto.ec2 import regioninfo from boto import exception as boto_exc # newer versions of boto use their own wrapper on top of httplib.HTTPResponse try: - from boto.connection import HTTPResponse + import boto.connection as httplib except ImportError: - from httplib import HTTPResponse + import httplib import fixtures import webob @@ -79,7 +79,7 @@ class FakeHttplibConnection(object): # guess that's a function the web server usually provides. resp = "HTTP/1.0 %s" % resp self.sock = FakeHttplibSocket(resp) - self.http_response = HTTPResponse(self.sock) + self.http_response = httplib.HTTPResponse(self.sock) # NOTE(vish): boto is accessing private variables for some reason self._HTTPConnection__response = self.http_response self.http_response.begin()