]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Various pep8/HACKING fixes for Cinder.
authorDan Prince <dprince@redhat.com>
Thu, 15 Nov 2012 16:26:31 +0000 (11:26 -0500)
committerDan Prince <dprince@redhat.com>
Thu, 15 Nov 2012 19:11:18 +0000 (14:11 -0500)
Fix some ordering/pep8/hacking issues in preperation for re-enabling
full pep8/HACKING checks in tox.

Change-Id: I7151ac73d1ace5d98046580e6d1c6a1dcc6c4cef

bin/cinder-clear-rabbit-queues
bin/cinder-manage
cinder/db/sqlalchemy/migration.py
cinder/utils.py
cinder/volume/san/san.py

index c39081458bd41e5ad8540f55e433a034800a35d4..e61da9a7324b34e2235aa4359c15ccf04ebe3adb 100755 (executable)
@@ -43,8 +43,8 @@ gettext.install('cinder', unicode=1)
 from cinder import context
 from cinder import exception
 from cinder import flags
-from cinder.openstack.common import log as logging
 from cinder.openstack.common import cfg
+from cinder.openstack.common import log as logging
 from cinder.openstack.common import rpc
 
 
index 9d13217425e6dc885b3080f463482ea4f7bfeee5..fb4b46a837c82cf0798b06f86c69ce3f196dfe32 100755 (executable)
@@ -60,8 +60,8 @@ import os
 import sys
 
 from sqlalchemy import create_engine, MetaData, Table
-from sqlalchemy.orm import sessionmaker
 from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy.orm import sessionmaker
 
 
 # If ../cinder/__init__.py exists, add ../ to Python search path, so that
@@ -79,8 +79,8 @@ from cinder import db
 from cinder.db import migration
 from cinder import exception
 from cinder import flags
-from cinder.openstack.common import log as logging
 from cinder.openstack.common import cfg
+from cinder.openstack.common import log as logging
 from cinder.openstack.common import rpc
 from cinder import utils
 from cinder import version
index b694682e874f347f34b51a91fae2e1a3daf3b2e3..5365d9cdcd078d0c1871ccc645eaa15d798ebeda 100644 (file)
@@ -26,9 +26,9 @@ from cinder import flags
 from cinder.openstack.common import log as logging
 
 
-import sqlalchemy
 import migrate
 from migrate.versioning import util as migrate_util
+import sqlalchemy
 
 
 LOG = logging.getLogger(__name__)
index df2894d5e1a2e004fdc012baacb610a4169cb959..19f7354f10ced884074f7a0998818cb920b3e705 100644 (file)
@@ -317,8 +317,8 @@ class SSHPool(pools.Pool):
             transport.set_keepalive(self.conn_timeout)
             return ssh
         except Exception as e:
-            msg = "Error connecting via ssh: %s" % e
-            LOG.error(_(msg))
+            msg = _("Error connecting via ssh: %s") % e
+            LOG.error(msg)
             raise paramiko.SSHException(msg)
 
     def get(self):
index c38a98cef620d33efe1de5fa12e878ecdfdca50d..dc2076ef770097e1ced63f539cd238f5672c717e 100644 (file)
@@ -122,11 +122,11 @@ class SanISCSIDriver(ISCSIDriver):
                     except Exception as e:
                         LOG.error(e)
                         greenthread.sleep(random.randint(20, 500) / 100.0)
-                raise paramiko.SSHException(_("SSH Command failed after '%r' "
-                                              "attempts: '%s'"
-                                              % (total_attempts, command)))
+                raise paramiko.SSHException(_("SSH Command failed after "
+                                              "'%(total_attempts)r' attempts"
+                                              ": '%(command)s'"), locals())
         except Exception as e:
-            LOG.error(_("Error running ssh command: %s" % command))
+            LOG.error(_("Error running ssh command: %s") % command)
             raise e
 
     def ensure_export(self, context, volume):