From d73a0046440b1c22cfb296fb0370905575739ab2 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Thu, 29 Dec 2011 10:55:42 -0500 Subject: [PATCH] Clean up pylint errors in top-level files Change-Id: Ida7cf1ff0cbf94ad82c7a75708c79ad7bb27f7fd --- nova/exception.py | 8 ++++---- nova/manager.py | 2 +- nova/quota.py | 1 - nova/test.py | 4 +--- nova/utils.py | 3 +-- nova/wsgi.py | 6 +----- 6 files changed, 8 insertions(+), 16 deletions(-) diff --git a/nova/exception.py b/nova/exception.py index 186a6ac58ec9..f2df97964046 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -24,10 +24,10 @@ SHOULD include dedicated exception logging. """ -from functools import wraps +import functools import sys -from novaclient import exceptions as novaclient_exceptions +import novaclient.exceptions import webob.exc from nova import log as logging @@ -51,7 +51,7 @@ def novaclient_converter(f): try: ret = f(*args, **kwargs) return ret - except novaclient_exceptions.ClientException, e: + except novaclient.exceptions.ClientException, e: raise ConvertedException(e.code, e.message, e.details) return new_f @@ -156,7 +156,7 @@ def wrap_exception(notifier=None, publisher_id=None, event_type=None, # re-raise original exception since it may have been clobbered raise exc_info[0], exc_info[1], exc_info[2] - return wraps(f)(wrapped) + return functools.wraps(f)(wrapped) return inner diff --git a/nova/manager.py b/nova/manager.py index 505fce345dfe..a5e50b4b6ce3 100644 --- a/nova/manager.py +++ b/nova/manager.py @@ -53,9 +53,9 @@ This module provides Manager, a base class for managers. """ +from nova.db import base from nova import flags from nova import log as logging -from nova.db import base from nova.scheduler import api from nova import version diff --git a/nova/quota.py b/nova/quota.py index e9ec4142f234..122959c58976 100644 --- a/nova/quota.py +++ b/nova/quota.py @@ -19,7 +19,6 @@ """Quotas for instances, volumes, and floating ips.""" from nova import db -from nova import exception from nova import flags diff --git a/nova/test.py b/nova/test.py index 448af047e6bd..1fc47f507ae8 100644 --- a/nova/test.py +++ b/nova/test.py @@ -31,13 +31,11 @@ import unittest import mox import nose.plugins.skip -import nova.image.fake -import shutil import stubout from nova import flags +import nova.image.fake from nova import log -from nova import rpc from nova import utils from nova import service from nova.testing.fake import rabbit diff --git a/nova/utils.py b/nova/utils.py index 9fb92f08da86..164ee08ddf41 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -25,7 +25,6 @@ import functools import inspect import json import lockfile -import netaddr import os import random import re @@ -43,11 +42,11 @@ from eventlet import event from eventlet import greenthread from eventlet import semaphore from eventlet.green import subprocess +import netaddr from nova import exception from nova import flags from nova import log as logging -from nova import version LOG = logging.getLogger("nova.utils") diff --git a/nova/wsgi.py b/nova/wsgi.py index 5ca0edd4562d..b94065b789d7 100644 --- a/nova/wsgi.py +++ b/nova/wsgi.py @@ -19,20 +19,16 @@ """Utility methods for working with WSGI servers.""" -import os import sys -from xml.dom import minidom - import eventlet import eventlet.wsgi import greenlet +from paste import deploy import routes.middleware import webob.dec import webob.exc -from paste import deploy - from nova import exception from nova import flags from nova import log as logging