ia64/xen-unstable

changeset 12253:13ea4bea8237

[XEND] Fix xen_version and missing os import

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Fri Nov 03 16:51:28 2006 +0000 (2006-11-03)
parents 3a0116aa7ff5
children 5ec45b464563
files tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/XendNode.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Fri Nov 03 15:47:05 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Fri Nov 03 16:51:28 2006 +0000
     1.3 @@ -29,6 +29,7 @@ import time
     1.4  import threading
     1.5  import re
     1.6  import copy
     1.7 +import os
     1.8  from types import StringTypes
     1.9  
    1.10  import xen.lowlevel.xc
     2.1 --- a/tools/python/xen/xend/XendNode.py	Fri Nov 03 15:47:05 2006 +0000
     2.2 +++ b/tools/python/xen/xend/XendNode.py	Fri Nov 03 16:51:28 2006 +0000
     2.3 @@ -80,9 +80,13 @@ class XendNode:
     2.4  
     2.5      def xen_version(self):
     2.6          info = self.xc.xeninfo()
     2.7 -        from xen import VERSION
     2.8 -        return {'Xen': '%(xen_major)d.%(xen_minor)d' % info,
     2.9 -                'Xend': VERSION}
    2.10 +        try:
    2.11 +            from xen import VERSION
    2.12 +            return {'Xen': '%(xen_major)d.%(xen_minor)d' % info,
    2.13 +                    'Xend': VERSION}
    2.14 +        except (ImportError, AttributeError):
    2.15 +            return {'Xen': '%(xen_major)d.%(xen_minor)d' % info,
    2.16 +                    'Xend': '3.0.3'}
    2.17  
    2.18      def get_name(self):
    2.19          return self.name