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
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
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
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__)
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):
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):