# HG changeset patch # User David Lutterkort <dlutter@xxxxxxxxxx> # Date 1197512462 28800 # Node ID 2f713d54e92e7699c43ac828ab4bab326275edd2 # Parent 557938724328c5b26e222f4a79d2e36b3a1e5d80 Move abspath to ImageParser.Image diff -r 557938724328 -r 2f713d54e92e virtinst/ImageManager.py --- a/virtinst/ImageManager.py Wed Dec 12 18:21:02 2007 -0800 +++ b/virtinst/ImageManager.py Wed Dec 12 18:21:02 2007 -0800 @@ -128,7 +128,7 @@ class ImageInstaller(Guest.Installer): return True def _abspath(self, p): - return os.path.abspath(os.path.join(self.image.base, p)) + return self.image.abspath(p) class PlatformMatchException(Exception): def __init__(self, msg): diff -r 557938724328 -r 2f713d54e92e virtinst/ImageParser.py --- a/virtinst/ImageParser.py Wed Dec 12 18:21:02 2007 -0800 +++ b/virtinst/ImageParser.py Wed Dec 12 18:21:02 2007 -0800 @@ -19,6 +19,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301 USA. +import os.path import libxml2 import CapabilitiesParser from virtinst import _virtinst as _ @@ -40,6 +41,11 @@ class Image: self.release = None if not node is None: self.parseXML(node) + + def abspath(self, p): + """Turn P into an absolute path. Relative paths are taken relative + to self.BASE""" + return os.path.abspath(os.path.join(self.base, p)) def parseXML(self, node): self.name = xpathString(node, "name") _______________________________________________ et-mgmt-tools mailing list et-mgmt-tools@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/et-mgmt-tools