ia64/xen-unstable

changeset 19716:a3125a83e40b

xm: xen-api: Install create.dtd in SHAREDIR

* Install create.dtd in SHAREDIR
* Use SHAREDIR/create.dtd
* import os.path.join into xenapi_create.py,
it already seems to be used many times

Resolves the following error when using XenAPI:

$ xm create hvm.conf
Couldn't open resource '/usr/share/xen/create.dtd' at
/usr/share/xen/create.dtd:1:0

Signed-off-by: Simon Horman <horms@verge.net.au>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 04 10:38:13 2009 +0100 (2009-06-04)
parents f569292aacc5
children 94f6bf69e8e8
files tools/python/Makefile tools/python/xen/xm/xenapi_create.py
line diff
     1.1 --- a/tools/python/Makefile	Thu Jun 04 10:37:39 2009 +0100
     1.2 +++ b/tools/python/Makefile	Thu Jun 04 10:38:13 2009 +0100
     1.3 @@ -22,6 +22,7 @@ genpath:
     1.4  	echo "BINDIR=\"$(BINDIR)\"" >> ${xenpath}
     1.5  	echo "LIBEXEC=\"$(LIBEXEC)\"" >> ${xenpath}
     1.6  	echo "LIBDIR=\"$(LIBDIR)\"" >> ${xenpath}
     1.7 +	echo "SHAREDIR=\"$(SHAREDIR)\"" >> ${xenpath}
     1.8  	echo "PRIVATE_BINDIR=\"$(PRIVATE_BINDIR)\"" >> ${xenpath}
     1.9  	echo "XEN_CONFIG_DIR=\"$(XEN_CONFIG_DIR)\"" >> ${xenpath}
    1.10  	echo "XEN_SCRIPT_DIR=\"$(XEN_SCRIPT_DIR)\"" >> ${xenpath}
    1.11 @@ -70,8 +71,8 @@ install: install-messages install-dtd
    1.12  		$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force
    1.13  
    1.14  install-dtd: all
    1.15 -	$(INSTALL_DIR) $(DESTDIR)$(DOCDIR)
    1.16 -	$(INSTALL_DATA) xen/xm/create.dtd $(DESTDIR)$(DOCDIR)
    1.17 +	$(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)
    1.18 +	$(INSTALL_DATA) xen/xm/create.dtd $(DESTDIR)$(SHAREDIR)
    1.19  
    1.20  install-messages: all
    1.21  	set -e; if which $(MSGFMT) >/dev/null ; then \
     2.1 --- a/tools/python/xen/xm/xenapi_create.py	Thu Jun 04 10:37:39 2009 +0100
     2.2 +++ b/tools/python/xen/xm/xenapi_create.py	Thu Jun 04 10:38:13 2009 +0100
     2.3 @@ -26,10 +26,12 @@ from xen.xend.XendAPIConstants import XE
     2.4       XEN_API_ON_CRASH_BEHAVIOUR
     2.5  from xen.xm.opts import OptionError
     2.6  from xen.util import xsconstants
     2.7 +from xen.util.path import SHAREDIR
     2.8  import xen.util.xsm.xsm as security
     2.9  
    2.10  import sys
    2.11  import os
    2.12 +from os.path import join
    2.13  import traceback
    2.14  import re
    2.15  
    2.16 @@ -75,7 +77,7 @@ class xenapi_create:
    2.17      def __init__(self):
    2.18          self.DEFAULT_STORAGE_REPOSITORY = get_default_SR()
    2.19  
    2.20 -        self.dtd = "/usr/share/xen/create.dtd"
    2.21 +        self.dtd = join(SHAREDIR, "create.dtd")
    2.22  
    2.23      def create(self, filename=None, document=None, skipdtd=False):
    2.24          """