fix fix and fix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2021-12-13 17:49:57 +01:00
parent 30104d46d3
commit 3c83d9370f

View File

@ -111,25 +111,25 @@ def run(redis_client: Redis, site_url_map: Dict[str, str]):
continue continue
# Select a fitting candidate from the lower rank sites # 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 candidate = None
for lower_rank_site in lower_rank_sites: for lower_rank_site in lower_rank_sites:
logging.debug(f"Evaluating {lower_rank_site}") logging.debug(f"Evaluating {lower_rank_site.name}")
recently_troubled = redis_client.get(f"RECENTTROUBLE:{lower_rank_site}") recently_troubled = redis_client.get(f"RECENTTROUBLE:{lower_rank_site.name}")
if recently_troubled: if recently_troubled:
recently_troubled = recently_troubled.decode('utf-8') recently_troubled = recently_troubled.decode('utf-8')
if recently_troubled: 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 continue
if lower_rank_site in incraising_queue_at: if lower_rank_site.name in incraising_queue_at:
logging.debug(f"Site {lower_rank_site} is not a good candidate: It's currently reporting in trouble...") logging.debug(f"Site {lower_rank_site.name} is not a good candidate: It's currently reporting in trouble...")
continue continue
logging.debug(f"{lower_rank_site} seems to be an ideal candidate to move a single workload to") logging.debug(f"{lower_rank_site.name} seems to be an ideal candidate to move a single workload to")
candidate = lower_rank_site candidate = lower_rank_site.name
break break
if not candidate: if not candidate:
@ -149,7 +149,7 @@ def run(redis_client: Redis, site_url_map: Dict[str, str]):
target = target.decode('utf-8') target = target.decode('utf-8')
if target == site_seeking_attention: if target == site_seeking_attention:
device_to_reschedule = key[10:] device_to_reschedule = key[10:].decode('utf-8')
break break
if not device_to_reschedule: if not device_to_reschedule: