[PATCH sandbox v5 11/20] Image: Add check_connect function

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

 



From: Eren Yagdiran <erenyagdiran@xxxxxxxxx>

Check if user-specified connect argument is valid

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

diff --git a/libvirt-sandbox/image/cli.py b/libvirt-sandbox/image/cli.py
index 6f9a5e7..2672a20 100755
--- a/libvirt-sandbox/image/cli.py
+++ b/libvirt-sandbox/image/cli.py
@@ -105,6 +105,12 @@ def requires_name(parser):
     parser.add_argument("-n","--name",
                         help=_("Name of the running sandbox"))
 
+def check_connect(connectstr):
+    supportedDrivers = ['lxc:///','qemu:///session','qemu:///system']
+    if not connectstr in supportedDrivers:
+        raise ValueError("URI '%s' is not supported by virt-sandbox-image" % connectstr)
+    return True
+
 def requires_source(parser):
     parser.add_argument("-s","--source",
                         default="docker",
-- 
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]