Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Apr 27, 2023
1 parent 7fe8968 commit 2222cf2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
13 changes: 9 additions & 4 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.0b81'
VERSION = '1.2.0b82'

# Read Env variables
DEBUG_LOG_LEVEL = os.environ.get('DebugLogLevel', 'INFO')
Expand Down Expand Up @@ -688,19 +688,24 @@ def lambda_handler(
f"2.1 instance: {instance_id}, using tag_option.name hostname {tag_data['option_name'].hostname} and and tag_option.name zone {tag_data['option_name'].zonename}")
f_hostname = tag_data['option_name'].hostname
f_zonename = tag_data['option_name'].zonename
elif not tag_data['option_name'].valid and tag_data['option_name'].hostname and tag_data['option_name'].zonename and all(flags['noforward'], flags['forcename']):
LOGGER.info(
f"2.2 instance: {instance_id}, using tag_option.name hostname {tag_data['option_name'].hostname} and and tag_option.name zone {tag_data['option_name'].zonename} [noforward,forcename]")
f_hostname = tag_data['option_name'].hostname
f_zonename = tag_data['option_name'].zonename
elif not tag_data['option_name'].valid and tag_data['option_name'].hostname and tag_data['dhcp_options'].valid:
LOGGER.info(
f"2.2 instance: {instance_id}, using tag_option.name hostname {tag_data['option_name'].hostname} and and tag_option.name zone {tag_data['option_name'].zonename}")
f"2.3 instance: {instance_id}, using tag_option.name hostname {tag_data['option_name'].hostname} and and tag_option.name zone {tag_data['dhcp_options'].zonename}")
f_hostname = tag_data['option_name'].hostname
f_zonename = tag_data['dhcp_options'].zonename
elif tag_data['name'].valid:
LOGGER.info(
f"2.3 instance: {instance_id}, using tag_key.Name hostname {tag_data['name'].hostname} and tag_key.Name zone {tag_data['name'].zonename}")
f"2.4 instance: {instance_id}, using tag_key.Name hostname {tag_data['name'].hostname} and tag_key.Name zone {tag_data['name'].zonename}")
f_hostname = tag_data['name'].hostname
f_zonename = tag_data['name'].zonename
elif not tag_data['name'].valid and tag_data['dhcp_options'].valid:
LOGGER.info(
f"2.4 instance: {instance_id}, using default ip-addresss hostname {default_hostname} and dhcp_options zone {tag_data['dhcp_options'].zonename}")
f"2.5 instance: {instance_id}, using default ip-addresss hostname {default_hostname} and dhcp_options zone {tag_data['dhcp_options'].zonename}")
f_hostname = default_hostname
f_zonename = tag_data['dhcp_options'].zonename
else:
Expand Down
Binary file modified code/ddns-lambda.zip
Binary file not shown.

0 comments on commit 2222cf2

Please sign in to comment.