summaryrefslogtreecommitdiffstats
path: root/nova/image
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-03-04 05:21:28 +0000
committerVishvananda Ishaya <vishvananda@gmail.com>2011-03-04 05:21:28 +0000
commitcf9bc248f0fc318c4a9fb5087f257216312e39d1 (patch)
tree20941422d1209147cdbea48844536930a1c51c5f /nova/image
parent13307e02258a5a08bedb1ed933a107668aac6457 (diff)
downloadnova-cf9bc248f0fc318c4a9fb5087f257216312e39d1.tar.gz
nova-cf9bc248f0fc318c4a9fb5087f257216312e39d1.tar.xz
nova-cf9bc248f0fc318c4a9fb5087f257216312e39d1.zip
fix a couple issues with local, update the glance fake to actually return the same types as the real client, fix the image tests
Diffstat (limited to 'nova/image')
-rw-r--r--nova/image/local.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/nova/image/local.py b/nova/image/local.py
index b4616729a..6fa648b6b 100644
--- a/nova/image/local.py
+++ b/nova/image/local.py
@@ -29,6 +29,7 @@ FLAGS = flags.FLAGS
flags.DEFINE_string('images_path', '$state_path/images',
'path to decrypted images')
+
class LocalImageService(service.BaseImageService):
"""Image service storing images to local disk.
@@ -97,18 +98,11 @@ class LocalImageService(service.BaseImageService):
"""
try:
- os.unlink(self._path_to(image_id))
+ shutil.rmtree(self._path_to(image_id, None))
except IOError:
raise exception.NotFound
def delete_all(self):
"""Clears out all images in local directory."""
for image_id in self._ids():
- os.unlink(self._path_to(image_id))
-
- def delete_imagedir(self):
- """Deletes the local directory.
- Raises OSError if directory is not empty.
-
- """
- os.rmdir(self._path)
+ shutil.rmtree(self._path_to(image_id, None))