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: I312664cb67ad51244cdcc5ae0eecdb739644a8df
ClosesBug: 1455698
  • Loading branch information
Ranjeet R committed May 20, 2015
1 parent eeacf36 commit 53c69f1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fabfile/tasks/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,17 +1118,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 53c69f1

Please sign in to comment.