Merge "Various pep8/HACKING fixes for Cinder."

This commit is contained in:
Jenkins 2012-11-15 21:55:26 +00:00 committed by Gerrit Code Review
commit 69ae5c145f
5 changed files with 10 additions and 10 deletions

View File

@ -43,8 +43,8 @@ gettext.install('cinder', unicode=1)
from cinder import context from cinder import context
from cinder import exception from cinder import exception
from cinder import flags from cinder import flags
from cinder.openstack.common import log as logging
from cinder.openstack.common import cfg from cinder.openstack.common import cfg
from cinder.openstack.common import log as logging
from cinder.openstack.common import rpc from cinder.openstack.common import rpc

View File

@ -61,8 +61,8 @@ import sys
import uuid import uuid
from sqlalchemy import create_engine, MetaData, Table from sqlalchemy import create_engine, MetaData, Table
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
# If ../cinder/__init__.py exists, add ../ to Python search path, so that # If ../cinder/__init__.py exists, add ../ to Python search path, so that
@ -80,8 +80,8 @@ from cinder import db
from cinder.db import migration from cinder.db import migration
from cinder import exception from cinder import exception
from cinder import flags from cinder import flags
from cinder.openstack.common import log as logging
from cinder.openstack.common import cfg from cinder.openstack.common import cfg
from cinder.openstack.common import log as logging
from cinder.openstack.common import rpc from cinder.openstack.common import rpc
from cinder import utils from cinder import utils
from cinder import version from cinder import version

View File

@ -26,9 +26,9 @@ from cinder import flags
from cinder.openstack.common import log as logging from cinder.openstack.common import log as logging
import sqlalchemy
import migrate import migrate
from migrate.versioning import util as migrate_util from migrate.versioning import util as migrate_util
import sqlalchemy
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -315,8 +315,8 @@ class SSHPool(pools.Pool):
transport.set_keepalive(self.conn_timeout) transport.set_keepalive(self.conn_timeout)
return ssh return ssh
except Exception as e: except Exception as e:
msg = "Error connecting via ssh: %s" % e msg = _("Error connecting via ssh: %s") % e
LOG.error(_(msg)) LOG.error(msg)
raise paramiko.SSHException(msg) raise paramiko.SSHException(msg)
def get(self): def get(self):

View File

@ -122,11 +122,11 @@ class SanISCSIDriver(ISCSIDriver):
except Exception as e: except Exception as e:
LOG.error(e) LOG.error(e)
greenthread.sleep(random.randint(20, 500) / 100.0) greenthread.sleep(random.randint(20, 500) / 100.0)
raise paramiko.SSHException(_("SSH Command failed after '%r' " raise paramiko.SSHException(_("SSH Command failed after "
"attempts: '%s'" "'%(total_attempts)r' attempts"
% (total_attempts, command))) ": '%(command)s'"), locals())
except Exception as e: except Exception as e:
LOG.error(_("Error running ssh command: %s" % command)) LOG.error(_("Error running ssh command: %s") % command)
raise e raise e
def ensure_export(self, context, volume): def ensure_export(self, context, volume):