From 4956657410d57861f9157167a291aefc437d9218 Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Tue, 21 Nov 2017 15:29:11 +0800 Subject: Support multi-cluster deploy JIRA: COMPASS-566 1. set DEPLOY_HOST to "true "no longer refresh compass-core 2. patch depends on merged compass-tasks 3. support assign cluster name in scenario file Change-Id: I28d201c201cff5baefee9993d195be16ef1e830b Signed-off-by: Harry Huang --- deploy/client.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'deploy/client.py') diff --git a/deploy/client.py b/deploy/client.py index 910aa7f8..891e632c 100644 --- a/deploy/client.py +++ b/deploy/client.py @@ -399,17 +399,20 @@ class CompassClient(object): except: raise RuntimeError('subnet %s format is invalid' % subnet) - if CONF.expansion == "false": + subnet_exist = False + for subnet_in_db in subnets_in_db: + if subnet == subnet_in_db['subnet']: + subnet_mapping[subnet] = subnet_in_db['id'] + subnet_exist = True + break + + if not subnet_exist: status, resp = self.client.add_subnet(subnet) LOG.info('add subnet %s status %s response %s', subnet, status, resp) if not self.is_ok(status): raise RuntimeError('failed to add subnet %s' % subnet) subnet_mapping[resp['subnet']] = resp['id'] - else: - for subnet_in_db in subnets_in_db: - if subnet == subnet_in_db['subnet']: - subnet_mapping[subnet] = subnet_in_db['id'] self.subnet_mapping = subnet_mapping @@ -475,8 +478,8 @@ class CompassClient(object): if host['hostname'] in hostnames: self.host_mapping[host['hostname']] = host['id'] - if CONF.expansion == "false": - assert(len(self.host_mapping) == len(machines)) + # if CONF.expansion == "false": + # assert(len(self.host_mapping) == len(machines)) def set_cluster_os_config(self, cluster_id): """set cluster os config.""" -- cgit 1.2.3-korg