diff options
| author | John Dewey <john@dewey.ws> | 2011-01-25 12:31:36 -0800 |
|---|---|---|
| committer | John Dewey <john@dewey.ws> | 2011-01-25 12:31:36 -0800 |
| commit | b1d2fc75d57080b3e0867f93aae71d0613d72d3c (patch) | |
| tree | 0394f9cb73fc3299bb09c70cbaa8e00bc43ed29e | |
| parent | b2d0a77c53d1bd108d233e58f68655381cec4e16 (diff) | |
| download | nova-b1d2fc75d57080b3e0867f93aae71d0613d72d3c.tar.gz nova-b1d2fc75d57080b3e0867f93aae71d0613d72d3c.tar.xz nova-b1d2fc75d57080b3e0867f93aae71d0613d72d3c.zip | |
No longer hard coding to "/tmp/nova/images/". Using tempdir so tests
run by different people on the same development machine pass.
| -rw-r--r-- | nova/image/local.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/nova/image/local.py b/nova/image/local.py index b44593221..908d72d1d 100644 --- a/nova/image/local.py +++ b/nova/image/local.py @@ -18,6 +18,7 @@ import cPickle as pickle import os.path import random +import tempfile from nova import exception from nova.image import service @@ -30,11 +31,7 @@ class LocalImageService(service.BaseImageService): It assumes that image_ids are integers.""" def __init__(self): - self._path = "/tmp/nova/images" - try: - os.makedirs(self._path) - except OSError: # Exists - pass + self._path = tempfile.mkdtemp() def _path_to(self, image_id): return os.path.join(self._path, str(image_id)) |
