mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
bitkeeper revision 1.689 (40118468UT1zIR80oFQpa0jMSoyUvA)
XenoUtil.py: Fix XenoUtil.py to import only what is necessary.
This commit is contained in:
1 parent
e83cf0f7c0
commit
735fd5d5b8
1 file changed
+13
-1
+13
-1
@@ -1,4 +1,4 @@
|
||||
import string, re, os, sqlite, Xc, sys
|
||||
import string, re, os, sys
|
||||
|
||||
##### Module variables
|
||||
|
||||
@@ -16,6 +16,16 @@ VD_DB_FILE = "/var/spool/xen_vdisks.sqlite"
|
||||
"""
|
||||
VBD_EXPERT_MODE = 0
|
||||
|
||||
##### Module initialisation
|
||||
|
||||
try:
|
||||
# try to import sqlite (not everyone will have it installed)
|
||||
import sqlite
|
||||
except ImportError:
|
||||
# on failure, just catch the error, don't do anything
|
||||
pass
|
||||
|
||||
|
||||
##### Networking-related functions
|
||||
|
||||
def get_current_ipaddr(dev='eth0'):
|
||||
@@ -808,6 +818,8 @@ def vd_extents_validate(new_extents,new_writeable):
|
||||
exceed VBD_EXPERT_MODE or -1 if it does (error)
|
||||
"""
|
||||
|
||||
import Xc # this is only needed in this function
|
||||
|
||||
xc = Xc.new()
|
||||
|
||||
##### Probe for explicitly created virtual disks and build a list
|
||||
|
||||