[PATCH sandbox v5 05/20] Image: virt-sandbox-image default dir constants

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Eren Yagdiran <erenyagdiran@xxxxxxxxx>

Define some constants to refer to the default image and
template storage directories

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 libvirt-sandbox/image/cli.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libvirt-sandbox/image/cli.py b/libvirt-sandbox/image/cli.py
index 3bf7d58..de34321 100755
--- a/libvirt-sandbox/image/cli.py
+++ b/libvirt-sandbox/image/cli.py
@@ -32,6 +32,16 @@ import sys
 import urllib2
 import subprocess
 
+if os.geteuid() == 0:
+    default_template_dir = "/var/lib/libvirt/templates"
+    default_image_dir = "/var/lib/libvirt/images"
+else:
+    default_template_dir = os.environ['HOME'] + "/.local/share/libvirt/templates"
+    default_image_dir = os.environ['HOME'] + "/.local/share/libvirt/images"
+
+debug = False
+verbose = False
+
 import importlib
 def dynamic_source_loader(name):
     name = name[0].upper() + name[1:]
-- 
2.4.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]