summaryrefslogtreecommitdiffstats
path: root/cobbler/action_import.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2007-10-17 18:11:51 -0400
committerMichael DeHaan <mdehaan@redhat.com>2007-10-17 18:11:51 -0400
commit4a7d0c46c7dd4ab46a4850bd462729d1ea6be497 (patch)
tree918f0f0b66de6cda083d8dd3d888fd7589c24cba /cobbler/action_import.py
parent940a0bbbe44db52c06514423823f865a6c579e3a (diff)
downloadthird_party-cobbler-4a7d0c46c7dd4ab46a4850bd462729d1ea6be497.tar.gz
third_party-cobbler-4a7d0c46c7dd4ab46a4850bd462729d1ea6be497.tar.xz
third_party-cobbler-4a7d0c46c7dd4ab46a4850bd462729d1ea6be497.zip
Various changes to allow for increased performance in the WebUI and in saving state, plus
a fix to import that keeps from creating extra yum repo entries for various distros.
Diffstat (limited to 'cobbler/action_import.py')
-rw-r--r--cobbler/action_import.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index 01e9396..d2ccb64 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -347,12 +347,22 @@ class Importer:
def repo_scanner(self,distro,dirname,fnames):
+ matches = {}
print "- processing: %s" % dirname
for x in fnames:
if x == "base" or x == "repodata":
- print "- need to process repo/comps: %s" % dirname
- self.process_comps_file(dirname, distro)
- continue
+ # only run the repo scanner on directories that contain a comps.xml
+ gloob1 = glob.glob("%s/%s/comps*.xml" % (dirname,x))
+ if len(gloob1) >= 1 or len(gloob2) >= 1:
+ if matches.has_key(dirname):
+ print _("- looks like we've already scanned here: %s") % dirname
+ continue
+ print _("- need to process repo/comps: %s") % dirname
+ self.process_comps_file(dirname, distro)
+ matches[dirname] = 1
+ else:
+ print _("- directory %s is missing comps.xml, skipping") % dirname
+ continue
# ----------------------------------------------------------------------