From f30aa5c121702d9706daf2eddac8b043dae7f827 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 9 Nov 2007 15:27:39 -0500 Subject: Since reposync (yum-utils >1.0.4) works with rhn_yum_plugin again, make some fixes to enable repo handling to work better. Repos are no longer symlinked so if a name of a repository is specified that uses a channel, the repo must be named after the channel.Tested with yum-utils 1.0.4 and works fine. --- cobbler/action_reposync.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'cobbler/action_reposync.py') diff --git a/cobbler/action_reposync.py b/cobbler/action_reposync.py index fdd9c3a..74a4d0d 100644 --- a/cobbler/action_reposync.py +++ b/cobbler/action_reposync.py @@ -153,6 +153,9 @@ class RepoSync: print _("- warning: --rpm-list is not supported for RHN content") rest = repo.mirror[6:] # everything after rhn:// cmd = "/usr/bin/reposync -r %s --download_path=%s" % (rest, store_path) + if repo.name != rest: + args = { "name" : repo.name, "rest" : rest } + raise CX(_("ERROR: repository %(name)s needs to be renamed %(rest)s as the name of the cobbler repository must match the name of the RHN channel") % args) if repo.arch != "": cmd = "%s -a %s" % (cmd, repo.arch) @@ -160,16 +163,6 @@ class RepoSync: print _("- %s") % cmd cmds.append(cmd) - # downloads using -r use the value given for -r as part of the output dir, - # so create a symlink with the name the user - # gave such that everything still works as intended and the sync code still works - # this doesn't happen for the http:// and ftp:// mirrors. - - if not os.path.exists(dest_path): - from1 = os.path.join(self.settings.webdir, "repo_mirror", rest) - print _("- symlink: %(from)s -> %(to)s") % { "from" : from1, "to" : dest_path } - os.symlink(from1, dest_path) - # now regardless of whether we're doing yumdownloader or reposync # or whether the repo was http://, ftp://, or rhn://, execute all queued # commands here. Any failure at any point stops the operation. -- cgit