ia64/xen-unstable

changeset 14469:126a2c3c6a9d

Only import xenapi_create when using the Xen-API server -- this has additional
dependencies that we don't want to require in legacy mode.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Mon Mar 19 14:46:51 2007 +0000 (2007-03-19)
parents bbda47597917
children ed1e4cc4a5b7
files tools/python/xen/xm/create.py
line diff
     1.1 --- a/tools/python/xen/xm/create.py	Mon Mar 19 14:00:07 2007 +0000
     1.2 +++ b/tools/python/xen/xm/create.py	Mon Mar 19 14:46:51 2007 +0000
     1.3 @@ -35,7 +35,6 @@ from xen.xend.XendBootloader import boot
     1.4  from xen.util import blkif
     1.5  from xen.util import security
     1.6  from xen.xm.main import serverType, SERVER_XEN_API, get_single_vm
     1.7 -from xen.xm.xenapi_create import sxp2xml, xenapi_create
     1.8  
     1.9  from xen.xm.opts import *
    1.10  
    1.11 @@ -1249,6 +1248,7 @@ def main(argv):
    1.12              raise OptionError("Cannot read file %s: %s" % (config, exn[1]))
    1.13  
    1.14      if serverType == SERVER_XEN_API:
    1.15 +        from xen.xm.xenapi_create import sxp2xml
    1.16          sxp2xml_inst = sxp2xml()
    1.17          doc = sxp2xml_inst.convert_sxp_to_xml(config, transient=True)
    1.18  
    1.19 @@ -1266,6 +1266,7 @@ def main(argv):
    1.20          do_console(sxp.child_value(config, 'name', -1))
    1.21      
    1.22      if serverType == SERVER_XEN_API:        
    1.23 +        from xen.xm.xenapi_create import xenapi_create
    1.24          xenapi_create_inst = xenapi_create()
    1.25          vm_refs = xenapi_create_inst.create(document = doc)
    1.26