mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
[XEND] Fix xen_version and missing os import
Signed-off-by: Alastair Tse <atse@xensource.com>
This commit is contained in:
1 parent
2791eeb645
commit
14267ebb9a
2 files changed
+8
-3
No files matched your search
@@ -29,6 +29,7 @@ import time
|
||||
import threading
|
||||
import re
|
||||
import copy
|
||||
import os
|
||||
from types import StringTypes
|
||||
|
||||
import xen.lowlevel.xc
|
||||
|
||||
@@ -80,9 +80,13 @@ class XendNode:
|
||||
|
||||
def xen_version(self):
|
||||
info = self.xc.xeninfo()
|
||||
from xen import VERSION
|
||||
return {'Xen': '%(xen_major)d.%(xen_minor)d' % info,
|
||||
'Xend': VERSION}
|
||||
try:
|
||||
from xen import VERSION
|
||||
return {'Xen': '%(xen_major)d.%(xen_minor)d' % info,
|
||||
'Xend': VERSION}
|
||||
except (ImportError, AttributeError):
|
||||
return {'Xen': '%(xen_major)d.%(xen_minor)d' % info,
|
||||
'Xend': '3.0.3'}
|
||||
|
||||
def get_name(self):
|
||||
return self.name
|
||||
|
||||