aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/augeas_utils.py9
-rw-r--r--src/frontend/main.py2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/augeas_utils.py b/src/backend/augeas_utils.py
index 8ec0749..6db6551 100644
--- a/src/backend/augeas_utils.py
+++ b/src/backend/augeas_utils.py
@@ -68,8 +68,11 @@ def getVentooModuleNameFromSysPath(a, sysPath):
"""
def getAugeasPathFromSystemPath(a, sysPath):
aug_root = a.get("/augeas/root")
- tmp = osp.relpath(sysPath, aug_root)
- return osp.join('files/', tmp)
+ if aug_root != '/':
+ tmp = osp.relpath(sysPath, aug_root)
+ else:
+ tmp = sysPath
+ return osp.join('/files/', stripLeadingSlash(tmp))
"""
Return an int that says how much to add to 'have' so that it matches mult.
@@ -193,12 +196,10 @@ def makeDiffTree(a, treeRoot):
files = accumulateFiles(a)
for i in range(len(files)): #append .augnew to each file.
files[i] += '.augnew'
- #pdb.set_trace()
a.save()
for f in files:
#each file could exist, copy the ones that do.
if osp.isfile(f):
- #pdb.set_trace()
try:
os.makedirs(osp.join("/tmp", userName, "augeas", stripLeadingSlash(osp.split(f)[0])))
except:
diff --git a/src/frontend/main.py b/src/frontend/main.py
index eded4cc..84dd7d9 100644
--- a/src/frontend/main.py
+++ b/src/frontend/main.py
@@ -133,7 +133,7 @@ class MainWindow(gtk.Window):
docPath = None
#if this is a comment node display all surround docs/comments
if osp.split(p)[1].startswith("#comment["):
- toDisplay = self.getDocsStartingAt(osp.join("/files", augeas_utils.stripBothSlashes(self.currentConfigFilePath), p), "<br>")
+ toDisplay = self.getDocsStartingAt(osp.join(augeas_utils.getAugeasPathFromSystemPath(self.a, self.currentConfigFilePath), p), "<br>")
docPath = "/tmp/commentsDoc.html"
outFile = open("/tmp/commentsDoc.html", 'w')
outFile.write("<html>\n")