Skip to content

Commit

Permalink
Merge pull request #460 from MirantisWorkloadMobility/devel
Browse files Browse the repository at this point in the history
Release 2015-10-04
  • Loading branch information
MirantisWorkloadMobility committed Oct 4, 2015
2 parents 4d01196 + 4d941c3 commit c4b0ee7
Show file tree
Hide file tree
Showing 114 changed files with 1,166 additions and 638 deletions.
1 change: 0 additions & 1 deletion addons/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
import aws_plugin
2 changes: 1 addition & 1 deletion addons/aws_plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

cfg_for_reg = [
(migrate, migrate_opts)
]
]
9 changes: 6 additions & 3 deletions cfglib.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,12 @@
help='IP or hostname used for creating MySQL dump for rollback.'
'If not set uses `[dst] db_host` config option.'),
cfg.BoolOpt('optimize_user_role_fetch', default=True,
help=("Uses low-level DB requests if set to True, "
"may be incompatible with more recent versions of "
"Keystone. Tested on grizzly, icehouse and juno."))
help="Uses low-level DB requests if set to True, "
"may be incompatible with more recent versions of "
"Keystone. Tested on grizzly, icehouse and juno."),
cfg.IntOpt('ssh_connection_attempts', default=3,
help='Number of times CloudFerry will attempt to connect when '
'connecting to a new server via SSH.'),
]

mail = cfg.OptGroup(name='mail',
Expand Down
2 changes: 1 addition & 1 deletion cloud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import cloud
import cloud_ferry
import os2os
import os2os
38 changes: 25 additions & 13 deletions cloud/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def __init__(self, resources, position, config):

def getIpSsh(self):
return self.cloud_config.cloud.ssh_host \
if self.cloud_config.cloud.ssh_host else self.cloud_config.cloud.host
if self.cloud_config.cloud.ssh_host \
else self.cloud_config.cloud.host

@staticmethod
def make_cloud_config(config, position):
Expand Down Expand Up @@ -75,8 +76,10 @@ def make_resource_config(config, position, cloud_config, resource_name):
def get_db_method_create_connection(resource, config):
def get_db_connection(db_name):
conf_res = getattr(config, resource)
conf = {k: getattr(conf_res, k, None) if getattr(conf_res, k, None) else config.mysql[k]
for k in config.mysql.keys()}
conf = {
k: getattr(conf_res, k, None) if getattr(conf_res, k, None)
else config.mysql[k]
for k in config.mysql.keys()}
db_name_use = getattr(conf_res, 'database_name')\
if getattr(conf_res, 'database_name', None) else db_name
return mysql_connector.MysqlConnector(conf, db_name_use)
Expand All @@ -85,16 +88,24 @@ def get_db_connection(db_name):
def init_resources(self, cloud_config):
resources = self.resources
self.resources = dict()
self.rbd_util = rbd_util.RbdUtil(getattr(self.config, "%s" % self.position), self.config.migrate)
self.qemu_img = qemu_img.QemuImg(getattr(self.config, "%s" % self.position), self.config.migrate)
self.ssh_util = ssh_util.SshUtil(getattr(self.config, "%s" % self.position), self.config.migrate)

identity_conf = self.make_resource_config(self.config, self.position,
cloud_config, 'identity')
self.rbd_util = rbd_util.RbdUtil(getattr(self.config,
"%s" % self.position),
self.config.migrate)
self.qemu_img = qemu_img.QemuImg(getattr(self.config,
"%s" % self.position),
self.config.migrate)
self.ssh_util = ssh_util.SshUtil(getattr(self.config,
"%s" % self.position),
self.config.migrate)

ident_conf = self.make_resource_config(self.config,
self.position,
cloud_config,
'identity')
self.mysql_connector = self.get_db_method_create_connection('identity',
identity_conf)
ident_conf)
identity = resources['identity'](
identity_conf,
ident_conf,
self)
self.resources['identity'] = identity

Expand All @@ -107,7 +118,8 @@ def init_resources(self, cloud_config):
self.position,
cloud_config,
resource)
self.mysql_connector = self.get_db_method_create_connection(resource,
resource_config)
self.mysql_connector = \
self.get_db_method_create_connection(resource,
resource_config)
self.resources[resource] = resources[resource](
resource_config, self)
Loading

0 comments on commit c4b0ee7

Please sign in to comment.