From 3c83d9370fb7211f4d6d8e3e8838741977407a1e Mon Sep 17 00:00:00 2001 From: marcsello Date: Mon, 13 Dec 2021 17:49:57 +0100 Subject: [PATCH] fix fix and fix --- birb_scheduler/run_scheduler.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/birb_scheduler/run_scheduler.py b/birb_scheduler/run_scheduler.py index 9ad7151..ced29d1 100644 --- a/birb_scheduler/run_scheduler.py +++ b/birb_scheduler/run_scheduler.py @@ -111,25 +111,25 @@ def run(redis_client: Redis, site_url_map: Dict[str, str]): continue # Select a fitting candidate from the lower rank sites - logging.debug(f"Selecting candidate out of these sites: {','.join(lower_rank_sites)}") + logging.debug(f"Selecting candidate out of these sites: {','.join(map(lambda x: x.name, lower_rank_sites))}") candidate = None for lower_rank_site in lower_rank_sites: - logging.debug(f"Evaluating {lower_rank_site}") - recently_troubled = redis_client.get(f"RECENTTROUBLE:{lower_rank_site}") + logging.debug(f"Evaluating {lower_rank_site.name}") + recently_troubled = redis_client.get(f"RECENTTROUBLE:{lower_rank_site.name}") if recently_troubled: recently_troubled = recently_troubled.decode('utf-8') if recently_troubled: - logging.debug(f"Site {lower_rank_site} had troubles recently, better not scheduling here...") + logging.debug(f"Site {lower_rank_site.name} had troubles recently, better not scheduling here...") continue - if lower_rank_site in incraising_queue_at: - logging.debug(f"Site {lower_rank_site} is not a good candidate: It's currently reporting in trouble...") + if lower_rank_site.name in incraising_queue_at: + logging.debug(f"Site {lower_rank_site.name} is not a good candidate: It's currently reporting in trouble...") continue - logging.debug(f"{lower_rank_site} seems to be an ideal candidate to move a single workload to") - candidate = lower_rank_site + logging.debug(f"{lower_rank_site.name} seems to be an ideal candidate to move a single workload to") + candidate = lower_rank_site.name break if not candidate: @@ -149,7 +149,7 @@ def run(redis_client: Redis, site_url_map: Dict[str, str]): target = target.decode('utf-8') if target == site_seeking_attention: - device_to_reschedule = key[10:] + device_to_reschedule = key[10:].decode('utf-8') break if not device_to_reschedule: