[sandbox PATCH 3/6] Only create the destination directory if it does not exist.

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

 



From: Dan Walsh <dwalsh@xxxxxxxxxx>

If a user specifies a path that already exists, we should just
use the path.
---
 bin/virt-sandbox-service | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/virt-sandbox-service b/bin/virt-sandbox-service
index 6524a05..308b871 100755
--- a/bin/virt-sandbox-service
+++ b/bin/virt-sandbox-service
@@ -258,7 +258,8 @@ class Container:
 
     def create(self):
         self.connect()
-        os.mkdir(self.dest)
+        if not os.path.exists(self.dest):
+            os.mkdir(self.dest)
 
     def connect(self):
         if not self.conn:
-- 
1.8.2

--
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]