Skip the cinder configuration in non-storage mode

1. Skip the cinder configuration in non-storage mode;
2. Modify the logic for dual-cloud mode check;

Change-Id: I3b6948d1d6c64ff678403e35e3d72edbf29f13a0
This commit is contained in:
Yichen Wang 2016-07-13 17:36:19 -07:00
parent fa13ab39b8
commit 26b38f11d3
4 changed files with 17 additions and 16 deletions

View File

@ -173,13 +173,12 @@ class KBConfig(object):
self.cred_tested = credentials.Credentials(openrc_file=CONF.tested_rc,
pwd=CONF.tested_passwd,
no_env=CONF.no_env)
if CONF.testing_rc and CONF.testing_rc != CONF.tested_rc:
if CONF.testing_rc:
self.cred_testing = credentials.Credentials(openrc_file=CONF.testing_rc,
pwd=CONF.testing_passwd,
no_env=CONF.no_env)
else:
# Use the same openrc file for both cases
self.cred_testing = self.cred_tested
self.cred_testing = None
def get_configs(self):
if CONF.config:

View File

@ -264,8 +264,9 @@ class KloudBuster(object):
else:
self.tenants_list = {'server': None, 'client': None}
# TODO(check on same auth_url instead)
self.single_cloud = True \
if server_cred.get_credentials() == client_cred.get_credentials() else False
self.single_cloud = False if client_cred else True
if client_cred:
self.client_cred = server_cred
# Automatically enable the floating IP for server cloud under dual-cloud mode
if not self.single_cloud and not self.server_cfg['use_floatingip']:
self.server_cfg['use_floatingip'] = True

View File

@ -128,6 +128,7 @@ class User(object):
nova_quota = base_compute.NovaQuota(self.nova_client, self.tenant.tenant_id)
nova_quota.update_quota(**tenant_quota['nova'])
if self.tenant.kloud.storage_mode:
cinder_quota = base_compute.CinderQuota(self.cinder_client, self.tenant.tenant_id)
cinder_quota.update_quota(**tenant_quota['cinder'])