Skip to content

Commit b1b820a

Browse files
author
Scot Kronenfeld
committed
Fix untagging when Tags key is not present.
1 parent 7d2c2b4 commit b1b820a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

aws_lambda/aws_lambda.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,9 @@ def update_function(
641641
for key, value in cfg.get('tags').items()
642642
}
643643
if tags != existing_cfg.get('Tags'):
644-
client.untag_resource(Resource=ret['FunctionArn'],
645-
TagKeys=list(existing_cfg['Tags'].keys()))
644+
if existing_cfg.get('Tags'):
645+
client.untag_resource(Resource=ret['FunctionArn'],
646+
TagKeys=list(existing_cfg['Tags'].keys()))
646647
client.tag_resource(Resource=ret['FunctionArn'], Tags=tags)
647648

648649

0 commit comments

Comments
 (0)