Skip to content

Commit

Permalink
fix: directory not empty & permission error (#677) (#686)
Browse files Browse the repository at this point in the history
* fix: directory not empty & permission error (#677)

* fix: cache is undefined error
  • Loading branch information
n30nx authored Mar 21, 2023
1 parent 7d2a2b5 commit 12d5fff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions terraform_compliance/extensions/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ def parse(self):
self.cache.set('mounted_resources', self.resources)
self.cache.set('resources_raw', self.resources_raw)
self.cache.set('type_to_after_unknown_properties', self.type_to_after_unknown_properties)
self.cache.close()

self._distribute_providers()

Expand Down
3 changes: 2 additions & 1 deletion terraform_compliance/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import shutil
import atexit
from argparse import ArgumentParser
from tempfile import mkdtemp
Expand Down Expand Up @@ -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__,
Expand Down

0 comments on commit 12d5fff

Please sign in to comment.