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
This commit is contained in:
Joe Gordon
2013-01-17 18:06:53 -05:00
parent 96f600ffa6
commit a615882802
3 changed files with 9 additions and 7 deletions

View File

@@ -25,7 +25,7 @@ import os
import sys import sys
from nova import config from nova import config
from nova.console import websocketproxy as ws from nova import console
from nova.openstack.common import cfg from nova.openstack.common import cfg
@@ -77,7 +77,8 @@ if __name__ == '__main__':
sys.exit(-1) sys.exit(-1)
# Create and start the NovaWebSockets proxy # 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, listen_port=CONF.novncproxy_port,
source_is_ipv6=CONF.source_is_ipv6, source_is_ipv6=CONF.source_is_ipv6,
verbose=CONF.verbose, verbose=CONF.verbose,

View File

@@ -25,7 +25,7 @@ import os
import sys import sys
from nova import config from nova import config
from nova.console import websocketproxy as ws from nova import console
from nova.openstack.common import cfg from nova.openstack.common import cfg
@@ -77,7 +77,8 @@ if __name__ == '__main__':
sys.exit(-1) sys.exit(-1)
# Create and start the NovaWebSockets proxy # 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, listen_port=CONF.spicehtml5proxy_port,
source_is_ipv6=CONF.source_is_ipv6, source_is_ipv6=CONF.source_is_ipv6,
verbose=CONF.verbose, verbose=CONF.verbose,

View File

@@ -26,9 +26,9 @@ from boto.ec2 import regioninfo
from boto import exception as boto_exc from boto import exception as boto_exc
# newer versions of boto use their own wrapper on top of httplib.HTTPResponse # newer versions of boto use their own wrapper on top of httplib.HTTPResponse
try: try:
from boto.connection import HTTPResponse import boto.connection as httplib
except ImportError: except ImportError:
from httplib import HTTPResponse import httplib
import fixtures import fixtures
import webob import webob
@@ -79,7 +79,7 @@ class FakeHttplibConnection(object):
# guess that's a function the web server usually provides. # guess that's a function the web server usually provides.
resp = "HTTP/1.0 %s" % resp resp = "HTTP/1.0 %s" % resp
self.sock = FakeHttplibSocket(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 # NOTE(vish): boto is accessing private variables for some reason
self._HTTPConnection__response = self.http_response self._HTTPConnection__response = self.http_response
self.http_response.begin() self.http_response.begin()