aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsconklin <sconklin@ef72aa8b-4018-0410-8976-d6e080ef94d8>2006-08-10 19:33:10 +0000
committersconklin <sconklin@ef72aa8b-4018-0410-8976-d6e080ef94d8>2006-08-10 19:33:10 +0000
commit4e76d8ea5f07e86aef79f6ea9585e4ec6f32913f (patch)
treeac28513df3e75a7884b99b324359eede7a1be6e6 /src
parent8e6eebb2c5bc7019aa29d3a2ceb4b9a90bcba0aa (diff)
downloadsos-4e76d8ea5f07e86aef79f6ea9585e4ec6f32913f.tar.gz
Fixed handling of directory symlinks and linking from the html report
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@39 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'src')
-rw-r--r--src/lib/sos/plugintools.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/sos/plugintools.py b/src/lib/sos/plugintools.py
index c09fc801..3e788199 100644
--- a/src/lib/sos/plugintools.py
+++ b/src/lib/sos/plugintools.py
@@ -61,7 +61,9 @@ class PluginBase:
copyProhibited = 1
if copyProhibited:
- return
+ sys.stderr.write("%s is on the copyProhibited list\n" % srcpath)
+ sys.stderr.flush
+ return ''
if os.path.islink(srcpath):
# This is a symlink - We need to also copy the file that it points to
@@ -83,6 +85,9 @@ class PluginBase:
# Create the symlink on the dst tree
rpth = sosRelPath(os.path.dirname(dstslname), dstsldir)
os.symlink(rpth, dstslname)
+ else:
+ # no adjustment, symlink is the relative path
+ dstslname = link
if os.path.isdir(srcpath):
for file in os.listdir(srcpath):
@@ -90,15 +95,19 @@ class PluginBase:
pass
else:
try:
- self.doCopyFileOrDir(srcpath+'/'+file)
+ abspath = self.doCopyFileOrDir(srcpath+'/'+file)
except:
- sys.stderr.write("Problem at path %s\n" % srcpath+'/'+file,)
+ sys.stderr.write("1Problem at path %s\n" % srcpath+'/'+file,)
sys.stderr.flush()
+ # if on forbidden list, abspath is null
+ if not abspath == '':
+ dstslname = sosRelPath(self.cInfo['rptdir'], abspath)
+ self.copiedDirs.append({'srcpath':srcpath, 'dstpath':dstslname, 'symlink':"yes", 'pointsto':link})
else:
try:
dstslname, abspath = self.__copyFile(srcpath)
except:
- sys.stderr.write("Problem at path %s\n" % srcpath)
+ sys.stderr.write("2Problem at path %s\n" % srcpath)
sys.stderr.flush()
self.copiedFiles.append({'srcpath':srcpath, 'dstpath':dstslname, 'symlink':"yes", 'pointsto':link})
@@ -107,7 +116,7 @@ class PluginBase:
try:
self.doCopyFileOrDir(newpath)
except:
- sys.stderr.write("Problem at path %s" % newpath,)
+ sys.stderr.write("3Problem at path %s" % newpath,)
sys.stderr.flush
return abspath
@@ -139,7 +148,7 @@ class PluginBase:
relpath = sosRelPath(self.cInfo['rptdir'], abspath)
return relpath, abspath
except Exception,e:
- sys.stderr.write("Problem copying file %s\n" % src,)
+ sys.stderr.write("4Problem copying file %s\n" % src,)
print e
def addForbiddenPath(self, forbiddenPath):