Skip to content

Commit

Permalink
Fixes: HA provisioning with fab fails if config nodes in testbed.py
Browse files Browse the repository at this point in the history
are not is sequential order ( The chosen master node is not the first node)

While comparing the openstack and cfgm node sets, we are sorting the
nodes which changes the order in which they are mentioned.

Changing the compare to use sets instead of using sort.

Change-Id: Iaa1577202965eeec899c8226321e8bd946f81844
ClosesBug: 1455698
  • Loading branch information
Ranjeet R committed May 20, 2015
1 parent 1292c61 commit 3e1c9cd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fabfile/tasks/helpers.py
Expand Up @@ -1119,17 +1119,18 @@ def pre_check():
print "\nERROR: \n\tkeystone_ip(VIP) needs to be set in testbed.py for HA, when more than one openstack node is defined."
exit(1)
if (len(env.roledefs['openstack']) > 1 and
env.roledefs['openstack'].sort() == env.roledefs['cfgm'].sort() and
set(env.roledefs['openstack']) == set(env.roledefs['cfgm']) and
get_openstack_internal_vip() != get_openstack_internal_vip()):
print "\nERROR: \n\tOpenstack and cfgm nodes are same, No need for contrail_internal_vip to be specified in testbed.py."
exit(1)
if (len(env.roledefs['openstack']) > 1 and
env.roledefs['openstack'].sort() != env.roledefs['cfgm'].sort() and
set(env.roledefs['openstack']) != set(env.roledefs['cfgm']) and
get_openstack_internal_vip() == get_openstack_internal_vip()):
print "\nERROR: \n\tOpenstack and cfgm nodes are different, Need to specify contrail_internal_vip testbed.py."
exit(1)
print "\nERROR: \n\tOpenstack and cfgm nodes are same, No need for contrail_internal_vip to be specified in testbed.py."
execute('add_openstack_reserverd_ports')
else:
print "\nINFO: \n\tOpenstack and cfgm nodes are same, No need for contrail_internal_vip to be specified in testbed.py."
execute('add_openstack_reserverd_ports')

def role_to_ip_dict(role=None):
role_to_ip_dict = {}
Expand Down

0 comments on commit 3e1c9cd

Please sign in to comment.