diff options
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/__init__.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py index 8d6ec59e..1d8a1898 100644 --- a/cloudinit/__init__.py +++ b/cloudinit/__init__.py @@ -318,3 +318,13 @@ class CloudInit: def device_name_to_device(self,name): return(self.datasource.device_name_to_device(name)) + + +def purge_cache(): + try: + os.unlink(data_source_cache) + except OSError as e: + if e.errno != errno.ENOENT: return(False) + except: + return(False) + return(True) |