storage: Use .local/libvirt/images for session URIs

.config isn't really appropriate
This commit is contained in:
Cole Robinson 2015-05-02 19:09:14 -04:00
parent 95cda55376
commit 015da05973
1 changed files with 3 additions and 1 deletions

View File

@ -82,7 +82,7 @@ class _StorageObject(XMLBuilder):
def _get_default_pool_path(conn):
path = "/var/lib/libvirt/images"
if conn.is_session_uri():
path = os.path.expanduser("~/.config/libvirt/images")
path = os.path.expanduser("~/.local/libvirt/images")
return path
@ -204,6 +204,8 @@ class StoragePool(_StorageObject):
pool = None
name = "default"
path = _get_default_pool_path(conn)
if conn.is_session_uri() and not os.path.exists(path):
os.makedirs(path)
try:
pool = conn.storagePoolLookupByName(name)