[sandbox PATCH v2 09/19] Image: Add check_connect function

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

 



Check if user-specified connect argument is valid
---
 virt-sandbox-image/virt-sandbox-image.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py
index feee849..4c19fa8 100755
--- a/virt-sandbox-image/virt-sandbox-image.py
+++ b/virt-sandbox-image/virt-sandbox-image.py
@@ -95,6 +95,12 @@ def create(args):
     except Exception,e:
         print "Create Error %s" % str(e)
 
+def check_connect(connectstr):
+        supportedDrivers = ['lxc:///','qemu:///session','qemu:///system']
+        if not connectstr in supportedDrivers:
+            raise ValueError("%s is not supported by Virt-sandbox" %connectstr)
+        return True
+
 def requires_name(parser):
     parser.add_argument("name",
                         help=_("name of the template"))
-- 
2.1.0

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