Skip to content

Commit

Permalink
Add progress bar to inventory sync
Browse files Browse the repository at this point in the history
Some inventory syncs take a long time to complete.
This change adds in a progress bar so users know there is actual
progress and have an estimated completion time.
  • Loading branch information
JacobCallahan committed May 1, 2023
1 parent 1188908 commit 3f0ce58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion broker/providers/ansible_tower.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,9 @@ def get_inventory(self, user=None):
for inv in invs:
inv_hosts = inv.get_related("hosts", page_size=200).results
hosts.extend(inv_hosts)
return [self._compile_host_info(host) for host in hosts]
with click.progressbar(hosts, label='Compiling host information') as hosts_bar:
compiled_host_info = [self._compile_host_info(host) for host in hosts_bar]
return compiled_host_info

def extend(self, target_vm, new_expire_time=None):
"""Run the extend workflow with defaults args
Expand Down

0 comments on commit 3f0ce58

Please sign in to comment.