diff --git a/src/quads/tools/simple_table_generator.py b/src/quads/tools/simple_table_generator.py index 11f12ad8..085f4129 100755 --- a/src/quads/tools/simple_table_generator.py +++ b/src/quads/tools/simple_table_generator.py @@ -167,8 +167,12 @@ async def generator(self, _host_file, _days, _month, _year, _gentime): total_hosts = len(hosts) total_use = len(total_current_schedules) - utilization = 100 - (non_allocated_count * 100 // (_days * total_hosts)) - utilization_daily = total_use * 100 // total_hosts + if int(total_hosts) == 0: + utilization_daily = 0 + utilization = 0 + else: + utilization = 100 - (non_allocated_count * 100 // (_days * total_hosts)) + utilization_daily = total_use * 100 // total_hosts with open(os.path.join(Config.TEMPLATES_PATH, "simple_table_emoji")) as _file: template = Template(_file.read()) content = template.render(