Skip to content

Commit

Permalink
fix tag prefix check for emr
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed May 11, 2023
1 parent a2adb62 commit 37ebb44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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 = '2.0.2'
VERSION = '2.0.3'

# Read Env variables
DEBUG_LOG_LEVEL = os.environ.get('DebugLogLevel', 'INFO')
Expand Down Expand Up @@ -3339,9 +3339,9 @@ def discover_emr_cluster(tags):
"""

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

result = cluster_tuple(is_cluster, is_master, cluster_id)
Expand Down

0 comments on commit 37ebb44

Please sign in to comment.