summaryrefslogtreecommitdiffstats
path: root/cobbler/action_reposync.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-06 12:45:27 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-06 12:45:27 -0400
commita72c34cae409841956d97b22e9102f723cb66d8e (patch)
treebd171967fec8e2b0a2b4174c60f03dd918da4838 /cobbler/action_reposync.py
parent36c7abaa74b11786cd5f3184c17938b516baf890 (diff)
downloadthird_party-cobbler-a72c34cae409841956d97b22e9102f723cb66d8e.tar.gz
third_party-cobbler-a72c34cae409841956d97b22e9102f723cb66d8e.tar.xz
third_party-cobbler-a72c34cae409841956d97b22e9102f723cb66d8e.zip
Ben Riggs patch to allow for reposyncs of explicit repos + tweak
to repo object to ensure items get serialized as booleans.
Diffstat (limited to 'cobbler/action_reposync.py')
-rw-r--r--cobbler/action_reposync.py38
1 files changed, 18 insertions, 20 deletions
diff --git a/cobbler/action_reposync.py b/cobbler/action_reposync.py
index 8c7e242..ac2cff8 100644
--- a/cobbler/action_reposync.py
+++ b/cobbler/action_reposync.py
@@ -38,25 +38,33 @@ class RepoSync:
"""
Constructor
"""
- self.verbose = True
- self.config = config
- self.distros = config.distros()
- self.profiles = config.profiles()
- self.systems = config.systems()
- self.settings = config.settings()
- self.repos = config.repos()
+ self.verbose = True
+ self.config = config
+ self.distros = config.distros()
+ self.profiles = config.profiles()
+ self.systems = config.systems()
+ self.settings = config.settings()
+ self.repos = config.repos()
- # ==================================================================================
- def run(self,verbose=True):
+ # ===================================================================
+
+ def run(self, args=[], verbose=True):
"""
Syncs the current repo configuration file with the filesystem.
"""
self.verbose = verbose
for repo in self.repos:
+ if args != [] and repo.name not in args:
+ continue
+ elif args == [] and not repo.keep_updated:
+ print _("- %s is set to not be updated") % repo.name
+ continue
+
repo_path = os.path.join(self.settings.webdir, "repo_mirror", repo.name)
mirror = repo.mirror
+
if not os.path.isdir(repo_path) and not repo.mirror.lower().startswith("rhn://"):
os.makedirs(repo_path)
@@ -67,7 +75,7 @@ class RepoSync:
return True
- # ==================================================================================
+ # ==================================================================
def do_reposync(self,repo):
@@ -92,13 +100,6 @@ class RepoSync:
if repo.rpm_list != "":
has_rpm_list = True
- # user might have disabled repo updates in the config file for whatever reason.
- # if so, don't update this one.
-
- if not repo.keep_updated:
- print _("- %s is set to not be updated") % repo.name
- return True
-
# create yum config file for use by reposync
store_path = os.path.join(self.settings.webdir, "repo_mirror")
dest_path = os.path.join(store_path, repo.name)
@@ -188,9 +189,6 @@ class RepoSync:
Handle copying of rsync:// and rsync-over-ssh repos.
"""
- if not repo.keep_updated:
- print _("- %s is set to not be updated") % repo.name
- return True
if repo.rpm_list != "":
print _("- warning: --rpm-list is not supported for rsync'd repositories")
dest_path = os.path.join(self.settings.webdir, "repo_mirror", repo.name)