diff --git a/tools/python/Makefile b/tools/python/Makefile index 7d9394cca9..295bd36ec8 100644 --- a/tools/python/Makefile +++ b/tools/python/Makefile @@ -22,6 +22,7 @@ genpath: echo "BINDIR=\"$(BINDIR)\"" >> ${xenpath} echo "LIBEXEC=\"$(LIBEXEC)\"" >> ${xenpath} echo "LIBDIR=\"$(LIBDIR)\"" >> ${xenpath} + echo "SHAREDIR=\"$(SHAREDIR)\"" >> ${xenpath} echo "PRIVATE_BINDIR=\"$(PRIVATE_BINDIR)\"" >> ${xenpath} echo "XEN_CONFIG_DIR=\"$(XEN_CONFIG_DIR)\"" >> ${xenpath} echo "XEN_SCRIPT_DIR=\"$(XEN_SCRIPT_DIR)\"" >> ${xenpath} @@ -70,8 +71,8 @@ install: install-messages install-dtd $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force install-dtd: all - $(INSTALL_DIR) $(DESTDIR)$(DOCDIR) - $(INSTALL_DATA) xen/xm/create.dtd $(DESTDIR)$(DOCDIR) + $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR) + $(INSTALL_DATA) xen/xm/create.dtd $(DESTDIR)$(SHAREDIR) install-messages: all set -e; if which $(MSGFMT) >/dev/null ; then \ diff --git a/tools/python/xen/xm/xenapi_create.py b/tools/python/xen/xm/xenapi_create.py index 2ae56de9c7..ae9c0326cd 100644 --- a/tools/python/xen/xm/xenapi_create.py +++ b/tools/python/xen/xm/xenapi_create.py @@ -26,10 +26,12 @@ from xen.xend.XendAPIConstants import XEN_API_ON_NORMAL_EXIT, \ XEN_API_ON_CRASH_BEHAVIOUR from xen.xm.opts import OptionError from xen.util import xsconstants +from xen.util.path import SHAREDIR import xen.util.xsm.xsm as security import sys import os +from os.path import join import traceback import re @@ -75,7 +77,7 @@ class xenapi_create: def __init__(self): self.DEFAULT_STORAGE_REPOSITORY = get_default_SR() - self.dtd = "/usr/share/xen/create.dtd" + self.dtd = join(SHAREDIR, "create.dtd") def create(self, filename=None, document=None, skipdtd=False): """