diff options
author | Daniel Veillard <veillard@redhat.com> | 2006-03-28 14:41:04 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2006-03-28 14:41:04 +0000 |
commit | 1027aa871cf478a54d77088199da8caabacbe3a0 (patch) | |
tree | efdb320396183d0cb7fd81f38e2f3ca110cef1f7 /tests/uuid.py | |
parent | 86dda3bcc733bd0cbb1b0c50417d677fe9ad2a98 (diff) | |
download | libvirt-python-split-1027aa871cf478a54d77088199da8caabacbe3a0.tar.gz libvirt-python-split-1027aa871cf478a54d77088199da8caabacbe3a0.tar.xz libvirt-python-split-1027aa871cf478a54d77088199da8caabacbe3a0.zip |
* python/libvir.c: call the initialize entry point
* src/libvirt_sym.version: add initialize entry point
* src/libvirt.c: make sure we always initialize the lib
* python/tests/*.py: start updating exemple for exception
handling as pointed by Jim Meyering
Daniel
Diffstat (limited to 'tests/uuid.py')
-rwxr-xr-x | tests/uuid.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/uuid.py b/tests/uuid.py index d71d420..605b759 100755 --- a/tests/uuid.py +++ b/tests/uuid.py @@ -19,16 +19,18 @@ if ids == None or len(ids) == 0: id = ids[-1] -dom = conn.lookupByID(id) -if dom == None: +try: + dom = conn.lookupByID(id) +except: print 'Failed to find the domain %d' sys.exit(1) name0 = dom.name() uuid = dom.UUID() print "Using domain %s" % (name0) -dom2 = conn.lookupByUUID(uuid) -if dom2 == None: +try: + dom2 = conn.lookupByUUID(uuid) +except: print 'Failed to lookup domain %d based on its UUID' sys.exit(1) if dom2.name() != name0: |