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