LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 11-15-2008, 08:49 AM   #1
rajeshux
LQ Newbie
 
Registered: Nov 2008
Posts: 15

Rep: Reputation: 0
Question Virtual Machine Manager - Invalid Syntax


Hi Linuxies!,

I was successfull in setting local repos and installing all dependencies for xen and virt-manager packages.

When I try to open virtual manager machine in gnome, i'm getting following error.

Code:
Traceback (most recent call last):
  File "/usr/local/share/virt-manager/virt-manager.py", line 346, in ?
    main()
  File "/usr/local/share/virt-manager/virt-manager.py", line 287, in main
    from virtManager.engine import vmmEngine
  File "/usr/local/share/virt-manager/virtManager/engine.py", line 31, in ?
    from virtManager.connection import vmmConnection
  File "/usr/local/share/virt-manager/virtManager/connection.py", line 36, in ?
    from virtManager.domain import vmmDomain
  File "/usr/local/share/virt-manager/virtManager/domain.py", line 669
    finally:
          ^
SyntaxError: invalid syntax
? I googled the error, it said something about "try,finally" python constructs. Can U globe it out.


Rajesh SR,Bangalore,India.
 
Old 11-17-2008, 05:52 AM   #2
stuart_cherrington
Member
 
Registered: Aug 2008
Location: Get back in your Cube Unix Boy!
Distribution: rh5, oel5, debian etch, solaris
Posts: 228

Rep: Reputation: 36
Did you run a command to open the Virtual manager? If so, what was it?

Stuart.
 
Old 11-19-2008, 03:53 PM   #3
mmarshall
Member
 
Registered: Apr 2004
Location: Bedford, Texas (DFW area)
Distribution: ArchLinux
Posts: 41

Rep: Reputation: 15
My first guess is that you're running python 2.3 or earlier, but this code is written for python 2.4 or later.

MWM
 
Old 11-19-2008, 03:55 PM   #4
mmarshall
Member
 
Registered: Apr 2004
Location: Bedford, Texas (DFW area)
Distribution: ArchLinux
Posts: 41

Rep: Reputation: 15
Oops, I got my python versions mixed up. The code requires python 2.5 but you probably have 2.4.

Here's a simple patch to domain.py that fixes the problem:

http://hg.et.redhat.com/virt/applica...s=a8cafeaa92a6

MWM
 
Old 11-19-2008, 11:32 PM   #5
rajeshux
LQ Newbie
 
Registered: Nov 2008
Posts: 15

Original Poster
Rep: Reputation: 0
I'm running from Gnome, system-tools->Virtual Machine Manager.

I'm currently using python 2.4.

How to apply the patch or should i install python 2.5 ?
 
Old 11-20-2008, 10:35 AM   #6
mmarshall
Member
 
Registered: Apr 2004
Location: Bedford, Texas (DFW area)
Distribution: ArchLinux
Posts: 41

Rep: Reputation: 15
I would just apply the patch manually.

Open up /usr/local/share/virt-manager/virtManager/domain.py, go to line 660, and change the code that looks like this:

Code:
        ctx = None
        ret = []
        try:
            doc = libxml2.parseDoc(self.get_xml())
            ctx = doc.xpathNewContext()
            ret = parse_function(ctx)
        except Exception, e:
            logging.debug("Error parsing domain xml: %s" % str(e))
        finally:
            if ctx:
                ctx.xpathFreeContext()
... so that it looks like this:

Code:
        ctx = None
        ret = []
        try:
            try:
                doc = libxml2.parseDoc(self.get_xml())
                ctx = doc.xpathNewContext()
                ret = parse_function(ctx)
            except Exception, e:
                logging.debug("Error parsing domain xml: %s" % str(e))
        finally:
            if ctx:
                ctx.xpathFreeContext()
You're just adding four spaces before every line between the "try:" and "finally:" lines and adding a second "try:" line. Make sure to get the indention just like I show above, using spaces, not tabs.

MWM
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to I swap CDs when installing a guest OS using the Virtual Machine Manager? jc_cpu Linux - Distributions 4 10-25-2008 11:21 PM
QEMU and Virtual Machine Manager joshfoulk Linux - Software 1 12-18-2007 11:57 AM
Virtual Machine Manager (Xen) in in Fedora 7 samthakur Linux - Software 0 11-15-2007 11:05 AM
Unable to install Virtual Machine In Rhel5 with Virt-manager with CD-Rom Source prasun_mitra Linux - Enterprise 0 08-30-2007 03:03 AM
virtual machine manager anant Linux - Newbie 1 01-02-2007 02:56 AM


All times are GMT -5. The time now is 03:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration