diff options
author | Scott Moser <smoser@ubuntu.com> | 2011-01-31 16:30:34 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2011-01-31 16:30:34 -0500 |
commit | 9e520d45a60a91750f9ad77da0be7dc58e57f4d8 (patch) | |
tree | 5b1f6837b4833aa66259939d75d410c482f293cb | |
parent | 0b0a684496932b9c627f5d566523bff0dbce07ac (diff) | |
download | vyos-cloud-init-9e520d45a60a91750f9ad77da0be7dc58e57f4d8.tar.gz vyos-cloud-init-9e520d45a60a91750f9ad77da0be7dc58e57f4d8.zip |
close file descriptors given to cPickle.load and cPickle.dump
-rw-r--r-- | cloudinit/__init__.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py index 64c260e9..7406e19f 100644 --- a/cloudinit/__init__.py +++ b/cloudinit/__init__.py @@ -153,6 +153,7 @@ class CloudInit: cache = get_ipath_cur('obj_pkl') f=open(cache, "rb") data = cPickle.load(f) + f.close() self.datasource = data return True except: @@ -169,6 +170,7 @@ class CloudInit: try: f=open(cache, "wb") data = cPickle.dump(self.datasource,f) + f.close() os.chmod(cache,0400) return True except: |