summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Dewey <john@dewey.ws>2011-01-25 18:09:02 -0800
committerJohn Dewey <john@dewey.ws>2011-01-25 18:09:02 -0800
commit45ad2dcaf97a373a6b62b78b115ae3c8eb4c47a1 (patch)
tree57a719e8e8697cf9df4f4d8c7b9f5bf3f62f9a80
parent5ef600a9b8ad8401bf4d1f4b4f4c771b88a2acc0 (diff)
downloadnova-45ad2dcaf97a373a6b62b78b115ae3c8eb4c47a1.tar.gz
nova-45ad2dcaf97a373a6b62b78b115ae3c8eb4c47a1.tar.xz
nova-45ad2dcaf97a373a6b62b78b115ae3c8eb4c47a1.zip
Fixing documentation strings. Second attempt at pep8.
Many of the files under nova/image/*.py do not appear to follow the same documentation string rules.
-rw-r--r--nova/image/local.py26
1 files changed, 11 insertions, 15 deletions
diff --git a/nova/image/local.py b/nova/image/local.py
index c4b7b9ad5..177e81a30 100644
--- a/nova/image/local.py
+++ b/nova/image/local.py
@@ -27,8 +27,8 @@ from nova.image import service
class LocalImageService(service.BaseImageService):
"""Image service storing images to local disk.
-
- It assumes that image_ids are integers."""
+ It assumes that image_ids are integers.
+ """
def __init__(self):
self._path = tempfile.mkdtemp()
@@ -53,41 +53,37 @@ class LocalImageService(service.BaseImageService):
raise exception.NotFound
def create(self, context, data):
- """
- Store the image data and return the new image id.
- """
+ """Store the image data and return the new image id."""
id = random.randint(0, 2 ** 31 - 1)
data['id'] = id
self.update(context, id, data)
return id
def update(self, context, image_id, data):
- """
- Replace the contents of the given image with the new data.
- """
+ """Replace the contents of the given image with the new data."""
try:
pickle.dump(data, open(self._path_to(image_id), 'w'))
except IOError:
raise exception.NotFound
def delete(self, context, image_id):
+ """Delete the given image.
+ Raises OSError if the image does not exist.
"""
- Delete the given image. Raises OSError if the image does not exist.
- """
+
try:
os.unlink(self._path_to(image_id))
except IOError:
raise exception.NotFound
def delete_all(self):
- """
- Clears out all images in local directory.
- """
+ """Clears out all images in local directory."""
for id in self._ids():
os.unlink(self._path_to(id))
def delete_imagedir(self):
+ """Deletes the local directory.
+ Raises OSError if directory is not empty.
"""
- Deletes the local directory. Raises OSError if directory is not empty.
- """
+
os.rmdir(self._path)