diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2007-11-09 15:27:39 -0500 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2007-11-09 15:27:39 -0500 |
commit | f30aa5c121702d9706daf2eddac8b043dae7f827 (patch) | |
tree | 267125f1aa37e72dd66b68de67d1c71e1b412ae3 /cobbler | |
parent | 168f5dc699ce410acc5abbc9e09dd1b795636b7d (diff) | |
download | third_party-cobbler-f30aa5c121702d9706daf2eddac8b043dae7f827.tar.gz third_party-cobbler-f30aa5c121702d9706daf2eddac8b043dae7f827.tar.xz third_party-cobbler-f30aa5c121702d9706daf2eddac8b043dae7f827.zip |
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.
Diffstat (limited to 'cobbler')
-rw-r--r-- | cobbler/action_reposync.py | 13 | ||||
-rw-r--r-- | cobbler/item_repo.py | 7 |
2 files changed, 10 insertions, 10 deletions
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. diff --git a/cobbler/item_repo.py b/cobbler/item_repo.py index 3424d75..67ea2e2 100644 --- a/cobbler/item_repo.py +++ b/cobbler/item_repo.py @@ -122,6 +122,13 @@ class Repo(item.Item): return False if self.mirror is None: return False + if self.mirror.startswith("rhn://"): + # reposync creates directories based on the channel name so this + # prevents a lot of ugly special case handling if we make the + # requirement that repo names match the channels. It makes sense too. + if self.mirror != "rhn://%s" % self.name: + args = { "m1" : self.mirror, "m2" : self.mirror.replace("rhn://","") } + raise CX(_("Since mirror is RHN %(m1)s, the repo must also be named %(m2)s") % args) return True def to_datastruct(self): |