I tried with the traceback. Here is the output:<br><br>[('<stdin>', 3, '?', None), ('/usr/lib/python2.3/site-packages/libvirt.py', 268, 'lookupByID', "if ret is None:raise libvirtError('virDomainLookupByID() failed')")]
<br>[('<stdin>', 3, '?', None), ('/usr/lib/python2.3/site-packages/libvirt.py', 268, 'lookupByID', "if ret is None:raise libvirtError('virDomainLookupByID() failed')")]
<br><br>Thanks<br>Omer<br><br><div><span class="gmail_quote">On 6/27/07, <b class="gmail_sendername">Daniel P. Berrange</b> <<a href="mailto:berrange@redhat.com">berrange@redhat.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Wed, Jun 27, 2007 at 03:39:30PM +0200, Omer Khalid wrote:<br>> Hi,<br>><br>> I have the following code working on libvirt 0.1.9:<br>><br>> ########################################<br>> conn = libvirt.openReadOnly
(None)<br>>            if conn == None:<br>>                print 'Failed to open connection to the hypervisor'<br>>                #sys.exit(1)<br>><br>>            try:<br>>                domains = 
conn.listDomainsID()<br>>                num  = conn.numOfDomains()<br>>            except:<br>>                print 'Failed to find the list of domains'<br>><br>> for i in range(num):<br>>                try:
<br>>                    dom0 = conn.lookupByID(domains[i])<br>>                    domInfo = dom0.info()<br>> except:<br>>                    print "Unexpected error:", sys.exc_info()<br>><br>> ##############################################
<br>><br>> For legacy reason, I have to get it working on libvirt 0.1.8 but I am<br>> constantly getting the following error:<br>><br>> Unexpected error: (<class libvirt.libvirtError at 0xb7f49f2c>, <
<br>> libvirt.libvirtError instance at 0xb7f4f2cc>, <traceback object at<br>> 0xb7f44c5c>)<br><br>Try adding an exception handler that prints out useful information<br>rather than raw python object references for a start... Its impossible
<br>to debug this unless you get the text associated with the exception.<br><br>Regards,<br>Dan.<br>--<br>|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|<br>|=-           Perl modules: <a href="http://search.cpan.org/~danberr/">
http://search.cpan.org/~danberr/</a>              -=|<br>|=-               Projects: <a href="http://freshmeat.net/~danielpb/">http://freshmeat.net/~danielpb/</a>               -=|<br>|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=|
<br></blockquote></div><br><br clear="all"><br>-- <br>----------------------------------------------------------   <br>CERN – European Organization for Nuclear<br>Research, IT Department,  CH-1211<br>Geneva 23, Switzerland
<br><br>Phone: +41 (0) 22 767 2224<br>Fax:     +41 (0) 22 766 8683<br>E-mail : <a href="mailto:Omer.Khalid@cern.ch">Omer.Khalid@cern.ch</a><br>Homepage: <a href="http://cern.ch/Omer.Khalid">http://cern.ch/Omer.Khalid</a>