ia64/xen-unstable

changeset 1765:0a953bcc44bb

bitkeeper revision 1.1074 (40f3b27b9znWwwTVgEKSTwPzTJCS0w)

Check Twisted version.
author mjw@wray-m-3.hpl.hp.com
date Tue Jul 13 09:59:23 2004 +0000 (2004-07-13)
parents b7c469ef6b99
children 1858589ab205
files tools/misc/xend
line diff
     1.1 --- a/tools/misc/xend	Tue Jul 13 09:05:58 2004 +0000
     1.2 +++ b/tools/misc/xend	Tue Jul 13 09:59:23 2004 +0000
     1.3 @@ -22,7 +22,25 @@ import os
     1.4  import sys
     1.5  from xen.xend.server import SrvDaemon
     1.6  
     1.7 +def check_twisted_version():
     1.8 +    """Check twisted version and print a warning if not high enough.
     1.9 +    """
    1.10 +    from twisted.copyright import version
    1.11 +    # Supported twisted release and major version.
    1.12 +    RELEASE = 1
    1.13 +    MAJOR   = 3
    1.14 +    (release, major, minor) = version.split('.')
    1.15 +    release = int(release)
    1.16 +    major = int(major)
    1.17 +    if release > RELEASE: return
    1.18 +    if release == RELEASE and major >= MAJOR: return
    1.19 +    print >>sys.stderr, "*" * 60
    1.20 +    print >>sys.stderr, "*" * 3, "Warning: Twisted version not supported: %s" % version
    1.21 +    print >>sys.stderr, "*" * 3, "Use Twisted version %d.%d.0 or higher" % (RELEASE, MAJOR)
    1.22 +    print >>sys.stderr, "*" * 60
    1.23 +
    1.24  def main():
    1.25 +    check_twisted_version()
    1.26      daemon = SrvDaemon.instance()
    1.27      if not sys.argv[1:]:
    1.28          print 'usage: %s {start|stop|restart}' % sys.argv[0]