Skip to content

Commit

Permalink
Merge pull request #684 from grycap/devel
Browse files Browse the repository at this point in the history
Fix error selecting the master VM
  • Loading branch information
micafer authored Oct 2, 2018
2 parents 5f7161a + 17ecf0a commit 0a2d62a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions IM/InfrastructureInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ def select_vm_master(self):
and store the value in the vm_master field
"""
self.vm_master = None
max_vms_connected = -1
for vm in self.get_vm_list():
max_vms_connected = -1
vms_connected = -1
if vm.getOS() and vm.getOS().lower() == 'linux' and vm.hasPublicNet():
# check that is connected with other VMs
Expand All @@ -438,8 +438,9 @@ def select_vm_master(self):
if not vm.isConnectedWith(other_vm):
vms_connected += 1

if vms_connected > max_vms_connected:
self.vm_master = vm
if vms_connected > max_vms_connected:
max_vms_connected = vms_connected
self.vm_master = vm

def vm_in_ctxt_tasks(self, vm):
found = False
Expand Down

0 comments on commit 0a2d62a

Please sign in to comment.