incubator-tashi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan, Michael P" <>
Subject RE: [question] getting tashi run smoothly
Date Thu, 08 Jan 2009 16:58:55 GMT
There are several places in the code that have the newer try/except/finally syntax.  It is
either necessary to replace all of them or to upgrade python.  What versions of python are
other people using in their environments?

- Michael

From: Daniel Mercer []
Sent: Thursday, January 08, 2009 11:51 AM
Cc: KunWang
Subject: Re: [question] getting tashi run smoothly


Prior to 2.5, to get try/except/finally behavior you need to nest two try blocks - one of
the so-called 'python warts'. Here is a patch to that ought to let it work with
earlier pythons.

Dan M.

---   (revision 732752)
+++   (working copy)
@@ -162,21 +162,22 @@
        args = map(lambda x: eval(x), sys.argv[1:])
-               res = f(*args)
-               if (os.getenv("USE_HTML_TABLES")):
-                       try:
-                               makeHTMLTable(res)
-                       except:
+               try:
+                       res = f(*args)
+                       if (os.getenv("USE_HTML_TABLES")):
+                               try:
+                                       makeHTMLTable(res)
+                               except:
+                                       pprint(res)
+                       else:
-               else:
-                       pprint(res)
-       except TashiException, e:
-               print e.msg
-               exitCode = e.errno
-       except TypeError, e:
-               print e
-               print "\t" + getFunctionInfo(function)
-               exitCode = -1
+               except TashiException, e:
+                       print e.msg
+                       exitCode = e.errno
+               except TypeError, e:
+                       print e
+                       print "\t" + getFunctionInfo(function)
+                       exitCode = -1

On 1/8/09 7:34 AM, "Ryan, Michael P" <> wrote:

I did a little more reading on the finally clause and it appears that it only started working
in it's current form on python2.5.
I installed CentOS 5.2 and I was able to get the same error message with python 2.4.3, but
once I installed 2.5.4, the messages went away.
Can you try running the following and report the version numbers?

$ /usr/bin/env python
$ /usr/bin/python

If either reports 2.4.3, I think you only need to change the #! at the top of the file (
to point to python2.5

- Michael

From: Ryan, Michael P []
Sent: Wednesday, January 07, 2009 5:54 PM
Cc: KunWang
Subject: RE: [question] getting tashi run smoothly

Those with_statement imports are unneccessary.  I just committed a fix that removes them.
 Just for reference, I am using Python 2.5.2.
Please try using trunk instead of the imported code (tashi/trunk instead of tashi/import/tashi-intel-r399).
I'm not sure why "finally" would be considered a syntax error.  I'm assuming you didn't modify
the code once you checked it out.
I'm currently downloading and installing CentOS 5 to test on and I will let you know if I
am able to reproduce the error.
The only other things I can think of checking are to revert to the older version of python
now that the with imports are removed and to make sure you have identical files:

$ md5sum ./trunk/src/tashi/client/ ./import/tashi-intel-r399/src/tashi/client/
de302c54d3236e468ba7c2e82d6ceafe  ./trunk/src/tashi/client/
7e9eabb435e989272a7a4d620f53f6ba  ./import/tashi-intel-r399/src/tashi/client/

- Michael

From: KunWang []
Sent: Tuesday, January 06, 2009 7:37 PM
To: Ryan, Michael P
Subject: RE: [question] getting tashi run smoothly


Thanks for your help.

I am using Xen on  CentOS 5.0 .

The default version of python is 2.4.3.
Following is the log when I was trying to do "make" under tashi-intel-r399 directory.
[root@mvm tashi-intel-r399]# make
  File "./", line 3
    from __future__ import with_statement
SyntaxError: future feature with_statement is not defined
make: *** [src/tashi/services] Error 1

Then I installed newer version of Python(Python 2.5.4)
The error happened in different place.
[root@ mvm tashi-intel-r399]# make
Generating Python code for 'services.thrift'...
Copying generated code to '' package...
Generatign Python code for 'messagingthrift'...
Copying generated code to 'tashi.messaging.messagingthrift' package...
Generating client symlinks...
  File "../src/tashi/client/", line 163
SyntaxError: invalid syntax
make: *** [bin/getInstances] Error 1

Does tashi require particular version of Python?
By the way, thrift is available on my machine.

Thanks again,

From: Ryan, Michael P []
Sent: Monday, January 05, 2009 11:28 AM
To: KunWang
Subject: RE: [question] get tashi run smoothly

Using migration in Tashi is dependent on using the migration provided by the VMM underneath
it.  Are you using Qemu/KVM or Xen?  If you are using Qemu/KVM, you need to be aware of some
of the limitations inherent in that VMM's implementation of live migration (the disk image
has to be served from the same file server, etc.).

The Makefile exists to reorganize the source tree to be usable -- as you stated, python is
not a compiled language.  It also uses thrift to dynamically create some python code.  I suspect
you would see many errors if you didn't have thrift installed.  Thrift is another Apache Incubator
project (

I'm glad to see you're trying to use Tashi and I'm glad to help you however I can.  If you
need more specific directions, we're working on some, but in the mean time, please send any
error messages you are getting so that I can respond to those individually.  The only request
I have is that you send questions like this to, which is CC'd
on this message.  Thanks.

- Michael


From: KunWang []
Sent: Friday, January 02, 2009 11:29 AM
To: Ryan, Michael P
Subject: [question] get tashi run smoothly
Dear Michael,

I watched your talk on
>From your talk, I find you are already  using tashi for migration. However, I encountered
some problem
when I was trying to use tashi to establish cloud computing environment in my lab.

I checked out my source code from

I followed this tutorial  to use tashi

I found there are several  Makefiles in the source tree.  Except for the utilities, many error
happened when
I was trying to use GNU make to "compile" the source code.
 Since Python is an interpretive language, I found the Makefile didn't do too much concrete
job. I can't find
enough documents on that website on installing tashi.

I am very interested in tashi. Could you please give me some advice to get tashi run smoothly
like you?
Thanks in advance.


View raw message