aboutsummaryrefslogtreecommitdiffstats
path: root/tools/misc/xend
diff options
context:
space:
mode:
authormjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>2004-07-13 09:59:23 +0000
committermjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>2004-07-13 09:59:23 +0000
commit6d83f76bb1e581e788ad0b9e097a70d36ea5e115 (patch)
tree873918105ec2110cfa1ef80dc4b823762b4f2cc6 /tools/misc/xend
parent4858287c8ec8d596a17f7e95d7e56e210ce8472e (diff)
downloadxen-6d83f76bb1e581e788ad0b9e097a70d36ea5e115.tar.gz
xen-6d83f76bb1e581e788ad0b9e097a70d36ea5e115.tar.bz2
xen-6d83f76bb1e581e788ad0b9e097a70d36ea5e115.zip
bitkeeper revision 1.1074 (40f3b27b9znWwwTVgEKSTwPzTJCS0w)
Check Twisted version.
Diffstat (limited to 'tools/misc/xend')
-rw-r--r--tools/misc/xend18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/misc/xend b/tools/misc/xend
index 06006490a4..232505e3b3 100644
--- a/tools/misc/xend
+++ b/tools/misc/xend
@@ -22,7 +22,25 @@ import os
import sys
from xen.xend.server import SrvDaemon
+def check_twisted_version():
+ """Check twisted version and print a warning if not high enough.
+ """
+ from twisted.copyright import version
+ # Supported twisted release and major version.
+ RELEASE = 1
+ MAJOR = 3
+ (release, major, minor) = version.split('.')
+ release = int(release)
+ major = int(major)
+ if release > RELEASE: return
+ if release == RELEASE and major >= MAJOR: return
+ print >>sys.stderr, "*" * 60
+ print >>sys.stderr, "*" * 3, "Warning: Twisted version not supported: %s" % version
+ print >>sys.stderr, "*" * 3, "Use Twisted version %d.%d.0 or higher" % (RELEASE, MAJOR)
+ print >>sys.stderr, "*" * 60
+
def main():
+ check_twisted_version()
daemon = SrvDaemon.instance()
if not sys.argv[1:]:
print 'usage: %s {start|stop|restart}' % sys.argv[0]