Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Apr 28, 2023
1 parent 8a036f2 commit 634e436
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions code/ddns-lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
LOGGER = logging.getLogger()
account_id = None
region = None
VERSION = '1.2.0b87'
VERSION = '1.2.0b88'

# Read Env variables
DEBUG_LOG_LEVEL = os.environ.get('DebugLogLevel', 'INFO')
Expand Down Expand Up @@ -1035,7 +1035,7 @@ def lambda_handler(
LOGGER.debug(f"cname_target: {final_private_dns_name} {lineno()}")
if emr_status.is_cluster:
LOGGER.info(
f"instance {instance_id}: is_cluster && is_master cluster_id {cluster_id} setting CNAME {cf_hostname} in zone {cf_zonename} {lineno()}")
f"instance {instance_id}: is_cluster && is_master cluster_id {emr_status.cluster_id} setting CNAME {cf_hostname} in zone {cf_zonename} {lineno()}")

create_response = create_resource_record(
route53,
Expand Down Expand Up @@ -3308,17 +3308,12 @@ def discover_emr_cluster(tags):
:return (bool,str): Tuple containing is_master, is_cluster, and cluster_id if it's a cluster. cluster_id will be empty if not a cluster.
"""

LOGGER.info(f"discover_emr tags {tags}")
cluster_tuple = namedtuple('EMRCluster', ['is_cluster', 'is_master', 'cluster_id'])
cluster_id = tags.get('emr:elasticmapreduce:job-flow-id', '')
LOGGER.info(f"discover_emr cluster_id {cluster_id}")
is_master = tags.get('emr:elasticmapreduce:instance-group-role', '') == 'MASTER'
LOGGER.info(f"discover_emr is_master {is_master}")
is_cluster = cluster_id != ''
LOGGER.info(f"discover_emr is_cluster {is_cluster}")

result = cluster_tuple(is_cluster, is_master, cluster_id)
LOGGER.info(f"discover_emr: {str(result)} {lineno()}")
return result


Expand Down

0 comments on commit 634e436

Please sign in to comment.