Skip to content

Commit

Permalink
Merge "Check for cfgm/database nodes and make sure cfgm is not subset…
Browse files Browse the repository at this point in the history
… of database nodes to decide config_db, also passing the correct ip address list for the seed list."
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Aug 3, 2016
2 parents f355870 + c6d822c commit 0270b3d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
10 changes: 10 additions & 0 deletions fabfile/tasks/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,16 @@ def pre_check():
exit(1)
else:
print "\nINFO: \n\tOpenstack and cfgm nodes are same, No need for contrail_internal_vip to be specified in testbed.py."
# Check the cfgm/database nodes
cfgm_nodes = deepcopy(env.roledefs['cfgm'])
if (set(cfgm_nodes) != set(database_nodes) and
set(database_nodes).issubset(set(cfgm_nodes))):
print "\nERROR: \n\tcfgm and database nodes should be in,"
print "\t 1.Different set of nodes or"
print "\t 2.Same set of nodes or"
print "\t 3.cfgm should be subset of database nodes."
exit(1)


def role_to_ip_dict(role=None):
role_to_ip_dict = {}
Expand Down
5 changes: 2 additions & 3 deletions fabfile/utils/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,9 @@ def frame_vnc_config_cmd(host_string, cmd="setup-vnc-config"):
cmd += " --amqp_port %s" % get_amqp_port()
cmd += " --orchestrator %s" % orch
if (len(env.roledefs['cfgm'])>2):
cmd += " --seed_list %s" % ','.join(database_ip_list[:2])
cmd += " --seed_list %s" % ','.join(get_config_db_ip_list()[:2])
else:
cmd += " --seed_list %s" % (hstr_to_ip(get_control_host_string(
env.roledefs['cfgm'][0])))
cmd += " --seed_list %s" % ','.join(get_config_db_ip_list())
database_dir = get_database_dir() or '/var/lib/cassandra/data'
cmd += " --data_dir %s" % database_dir
haproxy = get_haproxy()
Expand Down
6 changes: 5 additions & 1 deletion fabfile/utils/host.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import paramiko
from netaddr import *
from copy import deepcopy

from fabric.api import env, sudo, get, put
from fabric.context_managers import settings
Expand Down Expand Up @@ -392,7 +393,10 @@ def get_bgp_md5(host = env.host_string):


def manage_config_db():
cfgm_nodes = set(deepcopy(env.roledefs['cfgm']))
database_nodes = set(deepcopy(env.roledefs['database']))
if (get_from_testbed_dict('cfgm', 'manage_db', 'yes') == 'yes' and
set(env.roledefs['database']) != set(env.roledefs['cfgm'])):
database_nodes != cfgm_nodes and
not cfgm_nodes.issubset(database_nodes)):
return True
return False

0 comments on commit 0270b3d

Please sign in to comment.