100% fixes; thx ruff
This commit is contained in:
parent
e052708205
commit
16dc159ec4
1 changed files with 7 additions and 9 deletions
|
|
@ -131,21 +131,19 @@ def main():
|
|||
time_delta = 0
|
||||
jobs = []
|
||||
count = 0
|
||||
percent = 0
|
||||
percent = float(0)
|
||||
increment = float(100) / float(job_count )
|
||||
for layout in lin_conf.get_enabled_layouts():
|
||||
for hostgroup in layout.get_hostgroups():
|
||||
for service in hostgroup.get_services():
|
||||
for host in hostgroup.get_hosts():
|
||||
for period in service.get_periods():
|
||||
count += 1
|
||||
if job_count >= 100:
|
||||
if count % (job_count/100) == 0:
|
||||
percent += 1
|
||||
sys.stdout.write("Scheduling jobs. Be patient... " + str(percent) + "%\r")
|
||||
sys.stdout.flush()
|
||||
else:
|
||||
sys.stdout.write("Scheduling jobs. Be patient...\r")
|
||||
percent += increment
|
||||
if percent >= count:
|
||||
sys.stdout.write("Scheduling jobs. Be patient... " + str(count) + "%\r")
|
||||
sys.stdout.flush()
|
||||
while percent > count:
|
||||
count += 1
|
||||
|
||||
time_delta += float(args.delay)
|
||||
new_start_date = start_date + datetime.timedelta(seconds=time_delta)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue