kristofwillen / cfntagger

Mass tag resources in Cloudformation templates
GNU General Public License v3.0
4 stars 0 forks source link

cfntagger fails when running with empty CFN_TAGS envvar #6

Closed kristofwillen closed 2 years ago

kristofwillen commented 2 years ago

I'm running cfntagger with an empty config, as I only want to add the git tags. Doing so, cfntagger fails with an UnboundLocalError:

$ export CFN_TAGS='{}'
$ cfntagger -f ./template.yaml -s -g
[./template.yaml][Resource] CheckovStats => AWS::Serverless::Function
[./template.yaml][Resource] CheckovLogGroup => AWS::Logs::LogGroup

Traceback (most recent call last):
  File "/usr/local/bin/cfntagger", line 65, in <module>
    cfn_tagger.tag()
  File "/usr/local/lib/python3.10/site-packages/cfntagger/cfntagger.py", line 401, in tag
    self.resources[item]["Properties"]["Tags"] = [addtags]
UnboundLocalError: local variable 'addtags' referenced before assignment
kristofwillen commented 2 years ago

Fixed in 0.9.7