diff --git a/terraform_compliance/extensions/terraform.py b/terraform_compliance/extensions/terraform.py index a869f548..ee982377 100644 --- a/terraform_compliance/extensions/terraform.py +++ b/terraform_compliance/extensions/terraform.py @@ -583,6 +583,8 @@ def parse(self): for _, resource in self.resources.items(): self._expand_resource_tags(resource) + + self.cache.close() def _add_action_status(self): ''' diff --git a/terraform_compliance/main.py b/terraform_compliance/main.py index 1753cef4..861e6863 100644 --- a/terraform_compliance/main.py +++ b/terraform_compliance/main.py @@ -1,4 +1,5 @@ import os +import shutil import atexit from argparse import ArgumentParser from tempfile import mkdtemp @@ -35,7 +36,7 @@ class ArgHandling(object): def cleanup(): - os.remove(Defaults().cache_file) + shutil.rmtree(Defaults().cache_dir) def cli(arghandling=ArgHandling(), argparser=ArgumentParser(prog=__app_name__,