[sandbox PATCH 1/2] Verify that a created Generic Sandbox does not exist before creating it

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

 



From: Dan Walsh <dwalsh@xxxxxxxxxx>

---
 bin/virt-sandbox-service | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bin/virt-sandbox-service b/bin/virt-sandbox-service
index 942f788..d7f43a5 100755
--- a/bin/virt-sandbox-service
+++ b/bin/virt-sandbox-service
@@ -333,6 +333,9 @@ class GenericContainer(Container):
         self.save_config()
 
     def create(self):
+        config_path = self.get_config_path()
+        if os.path.exists(config_path):
+            raise ValueError([_("%s already exists") % config_path ])
         try:
             self.create_generic()
         except Exception, e:
-- 
1.8.2.1

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