summaryrefslogtreecommitdiffstats
path: root/packages.py
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2007-01-26 20:05:04 +0000
committerPeter Jones <pjones@redhat.com>2007-01-26 20:05:04 +0000
commitd58779bc13dd8b9b9e9d89c8a642ac364f6e4980 (patch)
tree8c1f6521d10c4d327d228d1c18b652b97379a812 /packages.py
parent12ea35b5f747b07754c1716e3679632320bbd7c2 (diff)
downloadanaconda-d58779bc13dd8b9b9e9d89c8a642ac364f6e4980.tar.gz
anaconda-d58779bc13dd8b9b9e9d89c8a642ac364f6e4980.tar.xz
anaconda-d58779bc13dd8b9b9e9d89c8a642ac364f6e4980.zip
- process directories recursively in setFileCon so that
/var/lib/iscsi/nodes/$target_name/%ip_address,$port and friends get relabelled correctly.
Diffstat (limited to 'packages.py')
-rw-r--r--packages.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/packages.py b/packages.py
index 7e4c3e6f3..468cb3ec3 100644
--- a/packages.py
+++ b/packages.py
@@ -212,13 +212,16 @@ def setFileCons(anaconda):
# ugh, this is ugly
for dir in ["/etc/sysconfig/network-scripts", "/var/lib/rpm", "/etc/lvm", "/dev/mapper", "/etc/iscsi", "/var/lib/iscsi"] + vgs:
- def addpath(x): return dir + "/" + x
-
- if not os.path.isdir(anaconda.rootPath + dir):
- continue
- dirfiles = os.listdir(anaconda.rootPath + dir)
- files.extend(map(addpath, dirfiles))
- files.append(dir)
+ def findfiles(path):
+ if not os.path.isdir(anaconda.rootPath + path):
+ files.extend(path)
+ return
+ dirfiles = os.listdir(anaconda.rootPath + path)
+ for file in dirfiles:
+ findfiles(path + '/' + file)
+ files.append(path)
+
+ findfiles(dir)
for f in files:
if not os.access("%s/%s" %(anaconda.rootPath, f), os.R_OK):