[autoscaler] Fix bad reference error when specifying IamInstanceProfile by name in config. (#14083)

This commit is contained in:
Patrick Ames 2021-02-15 16:29:36 -08:00 committed by GitHub
parent ebb6e552d2
commit da0c2c99a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,11 +155,11 @@ def log_to_cli(config):
_tags=workers_tags) _tags=workers_tags)
tags = {"default": _log_info["head_instance_profile_src"] == "default"} tags = {"default": _log_info["head_instance_profile_src"] == "default"}
cli_logger.labeled_value( profile_arn = config["head_node"]["IamInstanceProfile"].get("Arn")
"IAM Profile", profile_name = _arn_to_name(profile_arn) \
"{}", if profile_arn \
_arn_to_name(config["head_node"]["IamInstanceProfile"]["Arn"]), else config["head_node"]["IamInstanceProfile"]["Name"]
_tags=tags) cli_logger.labeled_value("IAM Profile", "{}", profile_name, _tags=tags)
if ("KeyName" in config["head_node"] if ("KeyName" in config["head_node"]
and "KeyName" in config["worker_nodes"]): and "KeyName" in config["worker_nodes"]):