Skip to content

Commit

Permalink
Fix broker skipping every other host during checkin --all
Browse files Browse the repository at this point in the history
This allows broker to truly checkin all hosts at once
  • Loading branch information
JacobCallahan committed Jul 1, 2020
1 parent f07ad84 commit 3f9b2d8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions broker/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,23 @@ def nick_help(self):
self._act(provider, "nick_help", checkout=False)

def checkin(self, host=None):
"""checkin one or more VMs"""
"""checkin one or more VMs
:param host: can be one of:
None - Will use the contents of self._hosts
A single host object
A list of host objects
A dictionary mapping host types to one or more host objects
"""
if host is None:
host = self._hosts
logger.debug(host)
if isinstance(host, dict):
for _host in host.values():
self.checkin(_host)
elif isinstance(host, list):
for _host in host:
# reversing over a copy of the list to avoid skipping
for _host in host[::-1]:
self.checkin(_host)
elif host:
logger.info(f"Checking in {host.hostname}")
Expand Down

0 comments on commit 3f9b2d8

Please sign in to comment.