summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-01-09 16:12:10 -0500
committerMichael DeHaan <mdehaan@redhat.com>2008-01-09 16:12:10 -0500
commit7a38e128564200c31a4249f9f63828b027e6b593 (patch)
tree1b758827becd3140c9ce076046bfc15b489566b2
parent2d710af47fa757350f999b73ca669152c6896979 (diff)
downloadthird_party-cobbler-7a38e128564200c31a4249f9f63828b027e6b593.tar.gz
third_party-cobbler-7a38e128564200c31a4249f9f63828b027e6b593.tar.xz
third_party-cobbler-7a38e128564200c31a4249f9f63828b027e6b593.zip
Added a parameter --yumopts which allows setting parameters for yum plugins in a manner
similar to how --kopts and --ksmeta works.
-rw-r--r--CHANGELOG40
-rw-r--r--cobbler/action_reposync.py5
-rw-r--r--cobbler/item_repo.py22
-rw-r--r--cobbler/modules/cli_repo.py10
-rw-r--r--cobbler/remote.py2
-rw-r--r--cobbler/settings.py2
-rw-r--r--cobbler/utils.py6
-rw-r--r--cobbler/webui/CobblerWeb.py10
-rw-r--r--docs/cobbler.pod15
-rw-r--r--webui_templates/repo_edit.tmpl13
-rw-r--r--webui_templates/repo_list.tmpl2
11 files changed, 81 insertions, 46 deletions
diff --git a/CHANGELOG b/CHANGELOG
index dc4dfbf..3bfe2e4 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,26 +1,10 @@
Cobbler CHANGELOG
(all entries mdehaan@redhat.com unless noted otherwise)
-* Fri Dec 15 2007 - 0.7.1
-- ...
-
-* Thu Dec 14 2007 - 0.7.0
-- Testing branch
-- Fix bug related to <<inherit>> and kickstart args
-- Make CLI functions modular and use optparse
-- Quote wget args to avoid creating stray files on target system
-- Support Xen FV as virt type (requires F8+)
-- Implemented fully pluggable authn/authz system
-- WebUI is now mod_python based
-- Greatly enhanced logging (goes to /var/log/cobbler/cobbler.log)
-- New --no-triggers and --no-sync on "adds" for performance and other reasons
-- pxe_just_once is now much faster.
-- performance testing scripts (in source checkout)
-- webui now uses Apache logging
-- misc webui fixes
-- remove -b from wgets since busybox doesn't have -b in wget
-- rename default/sample kickstarts to avoid confusion
+* Wed Jan 09 2007 - 0.7.1
- allow imports to force usage of a specific kickstart template with --kickstart
+- added --yumopts parameter to repos (works just like --kopts/--ksmeta)
+- minor doc fixes
- ...
* Wed Nov 14 2007 - 0.6.4
@@ -242,6 +226,24 @@ Cobbler CHANGELOG
older releases (for now). The CLI still takes the --xen options
as well as the new --virt options, as they are aliased. The API
now exclusively just uses methods with "virt" in them, however.
+- ...
+
+* Thu Dec 14 2007 - 0.7.0
+- Testing branch
+- Fix bug related to <<inherit>> and kickstart args
+- Make CLI functions modular and use optparse
+- Quote wget args to avoid creating stray files on target system
+- Support Xen FV as virt type (requires F8+)
+- Implemented fully pluggable authn/authz system
+- WebUI is now mod_python based
+- Greatly enhanced logging (goes to /var/log/cobbler/cobbler.log)
+- New --no-triggers and --no-sync on "adds" for performance and other reasons
+- pxe_just_once is now much faster.
+- performance testing scripts (in source checkout)
+- webui now uses Apache logging
+- misc webui fixes
+- remove -b from wgets since busybox doesn't have -b in wget
+- rename default/sample kickstarts to avoid confusion
- Fixed some bugs related to kickstart templating
* Tue Oct 24 2006 - 0.3.0
diff --git a/cobbler/action_reposync.py b/cobbler/action_reposync.py
index 27491fa..265bf48 100644
--- a/cobbler/action_reposync.py
+++ b/cobbler/action_reposync.py
@@ -237,12 +237,17 @@ class RepoSync:
if output:
line = "baseurl=http://${server}/cobbler/repo_mirror/%s\n" % (repo.name)
config_file.write(line)
+ # user may have options specific to certain yum plugins
+ # add them to the file
+ for x in repo.yumopts:
+ config_file.write("%s=%s\n" % (x, repo.yumopts[x]))
else:
line = "baseurl=%s\n" % repo.mirror
line = line.replace("@@server@@",self.settings.server)
config_file.write(line)
config_file.write("enabled=1\n")
config_file.write("priority=%s\n" % repo.priority)
+ # FIXME: potentially might want a way to turn this on/off on a per-repo basis
config_file.write("gpgcheck=0\n")
config_file.close()
return fname
diff --git a/cobbler/item_repo.py b/cobbler/item_repo.py
index 659e3a8..a7b1f3b 100644
--- a/cobbler/item_repo.py
+++ b/cobbler/item_repo.py
@@ -38,6 +38,7 @@ class Repo(item.Item):
self.createrepo_flags = ("-c cache", '<<inherit>>')[is_subobject]
self.depth = 2 # arbitrary, as not really apart of the graph
self.arch = "" # use default arch
+ self.yumopts = {}
def from_datastruct(self,seed_data):
self.parent = self.load_item(seed_data, 'parent')
@@ -49,6 +50,7 @@ class Repo(item.Item):
self.createrepo_flags = self.load_item(seed_data, 'createrepo_flags', '-c cache')
self.arch = self.load_item(seed_data, 'arch')
self.depth = self.load_item(seed_data, 'depth', 2)
+ self.yumopts = self.load_item(seed_data, 'yumopts', {})
# force this to be saved as a boolean
self.set_keep_updated(self.keep_updated)
@@ -83,6 +85,18 @@ class Repo(item.Item):
self.keep_updated = False
return True
+ def set_yumopts(self,options):
+ """
+ Kernel options are a space delimited list,
+ like 'a=b c=d e=f g h i=j' or a hash.
+ """
+ (success, value) = utils.input_string_or_hash(options,None)
+ if not success:
+ raise CX(_("invalid yum options"))
+ else:
+ self.yumopts = value
+ return True
+
def set_priority(self,priority):
"""
Set the priority of the repository. 1= highest, 99=default
@@ -154,7 +168,8 @@ class Repo(item.Item):
'createrepo_flags' : self.createrepo_flags,
'arch' : self.arch,
'parent' : self.parent,
- 'depth' : self.depth
+ 'depth' : self.depth,
+ 'yumopts' : self.yumopts
}
def printable(self):
@@ -165,6 +180,7 @@ class Repo(item.Item):
buf = buf + _("rpm list : %s\n") % self.rpm_list
buf = buf + _("createrepo_flags : %s\n") % self.createrepo_flags
buf = buf + _("arch : %s\n") % self.arch
+ buf = buf + _("yum options : %s\n") % self.yumopts
return buf
def get_parent(self):
@@ -193,5 +209,7 @@ class Repo(item.Item):
'keep-updated' : self.set_keep_updated,
'priority' : self.set_priority,
'rpm-list' : self.set_rpm_list,
- 'createrepo-flags' : self.set_createrepo_flags
+ 'createrepo-flags' : self.set_createrepo_flags,
+ 'yumopts' : self.set_yumopts
}
+
diff --git a/cobbler/modules/cli_repo.py b/cobbler/modules/cli_repo.py
index 8bfeb8e..96afa6f 100644
--- a/cobbler/modules/cli_repo.py
+++ b/cobbler/modules/cli_repo.py
@@ -41,12 +41,15 @@ class RepoFunction(commands.CobblerFunction):
p.add_option("--arch", dest="arch", help="overrides repo arch if required")
p.add_option("--createrepo-flags", dest="createrepo_flags", help="additional flags for createrepo")
- p.add_option("--rpm-list", dest="rpm_list", help="just mirror these rpms")
p.add_option("--keep-updated", dest="keep_updated", help="update on each reposync, yes/no")
- p.add_option("--priority", dest="priority", help="set priority")
- p.add_option("--mirror", dest="mirror", help="source to mirror (REQUIRED)")
p.add_option("--name", dest="name", help="ex: 'Fedora-8-updates-i386' (REQUIRED)")
+
+ if not self.matches_args(args,["remove","report","list"]):
+ p.add_option("--mirror", dest="mirror", help="source to mirror (REQUIRED)")
+ p.add_option("--priority", dest="priority", help="set priority")
+ p.add_option("--rpm-list", dest="rpm_list", help="just mirror these rpms")
+ p.add_option("--yumopts", dest="yumopts", help="ex: pluginvar=abcd")
if self.matches_args(args,["copy","rename"]):
@@ -70,6 +73,7 @@ class RepoFunction(commands.CobblerFunction):
if self.options.keep_updated: obj.set_keep_updated(self.options.keep_updated)
if self.options.priority: obj.set_priority(self.options.priority)
if self.options.mirror: obj.set_mirror(self.options.mirror)
+ if self.options.yumopts: obj.set_yumopts(self.options.yumopts)
return self.object_manipulator_finish(obj, self.api.repos, self.options)
diff --git a/cobbler/remote.py b/cobbler/remote.py
index 898e712..c00cbf3 100644
--- a/cobbler/remote.py
+++ b/cobbler/remote.py
@@ -673,7 +673,7 @@ class CobblerReadWriteXMLRPCInterface(CobblerXMLRPCInterface):
Creates a new (unconfigured) repo object. See the documentation
for new_distro as it works exactly the same.
"""
- self.debug("new_repo",token=token)
+ self.log("new_repo",token=token)
self.check_access(token,"new_repo")
return self.__store_object(item_repo.Repo(self.api._config))
diff --git a/cobbler/settings.py b/cobbler/settings.py
index c1fe232..1c63a34 100644
--- a/cobbler/settings.py
+++ b/cobbler/settings.py
@@ -38,7 +38,7 @@ DEFAULTS = {
"kernel_options" : {
"lang" : " ",
"text" : None,
- "ksdevice" : "eth0",
+ "ksdevice" : "eth0"
},
"manage_dhcp" : 0,
"manage_dhcp_mode" : "isc",
diff --git a/cobbler/utils.py b/cobbler/utils.py
index 13503e5..20a5d67 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -21,7 +21,6 @@ import sub_process
import shutil
import string
import traceback
-import logging
from cexceptions import *
from rhpl.translate import _, N_, textdomain, utf8
@@ -338,13 +337,12 @@ def flatten(data):
# this should not be done for everything
if data.has_key("kernel_options"):
data["kernel_options"] = hash_to_string(data["kernel_options"])
- # FIXME: why do we flatten this?
+ if data.has_key("yumopts"):
+ data["yumopts"] = hash_to_string(data["yumopts"])
if data.has_key("ks_meta"):
data["ks_meta"] = hash_to_string(data["ks_meta"])
- # FIXME: why do we flatten this?
if data.has_key("repos") and type(data["repos"]) == list:
data["repos"] = " ".join(data["repos"])
- # FIXME: why do we flatten this?
if data.has_key("rpm_list") and type(data["rpm_list"]) == list:
data["rpm_list"] = " ".join(data["rpm_list"])
diff --git a/cobbler/webui/CobblerWeb.py b/cobbler/webui/CobblerWeb.py
index ae9b2b9..3d14d7d 100644
--- a/cobbler/webui/CobblerWeb.py
+++ b/cobbler/webui/CobblerWeb.py
@@ -17,7 +17,6 @@ import os
import traceback
import string
from cobbler.utils import *
-import logging
import sys
def log_exc(apache):
@@ -576,7 +575,8 @@ class CobblerWeb(object):
def repo_save(self,name=None,oldname=None,new_or_edit=None,editmode="edit",
mirror=None,keep_updated=None,priority=99,
- rpm_list=None,createrepo_flags=None,arch=None,delete1=None,delete2=None,**args):
+ rpm_list=None,createrepo_flags=None,arch=None,yumopts=None,
+ delete1=None,delete2=None,**args):
if not self.__xmlrpc_setup():
return self.xmlrpc_auth_failure()
@@ -618,9 +618,11 @@ class CobblerWeb(object):
if rpm_list:
self.remote.modify_repo(repo, 'rpm-list', rpm_list, self.token)
if createrepo_flags:
- self.remote.modify_distro(repo, 'createrepo-flags', createrepo_flags, self.token)
+ self.remote.modify_repo(repo, 'createrepo-flags', createrepo_flags, self.token)
if arch:
- self.remote.modify_distro(repo, 'arch', arch, self.token)
+ self.remote.modify_repo(repo, 'arch', arch, self.token)
+ if yumopts:
+ self.remote.modify_repo(repo, 'yumopts', yumopts, self.token)
self.remote.save_repo(repo, self.token)
diff --git a/docs/cobbler.pod b/docs/cobbler.pod
index ea22bbd..2ea6db9 100644
--- a/docs/cobbler.pod
+++ b/docs/cobbler.pod
@@ -317,17 +317,6 @@ Distros that can make use of yum repositories during kickstart include FC6 and l
See the documentation on "cobbler profile add" for more information.
-=item local-filename
-
-Local filename specifies, for kickstarts containing the template parameter "yum_config_stanza",
-what files to populate on provisioned clients in /etc/yum.repos.d.
-
-In other words, if this value is "foo", the repo would be installed on provisioned clients as "/etc/yum.repos.d/foo.repo".
-
-If you don't want clients to have this repo installed, don't add a name for the repo, and provisioned machines will not configure yum to know about this repo -- you can still do it manually if you choose. The repository will still be used for installation, it just won't get installed automatically in /etc/yum.repos.d on the client.
-
-See /etc/cobbler/kickstart_fc6.ks for an example of how to employ this within a kickstart template.
-
=item rpm-list
By specifying a space-delimited list of package names for --rpm-list, one can decide to mirror only a part of a repo (the list of packages given, plus dependencies). This may be helpful in conserving time/space/bandwidth. For instance, when mirroring FC6 Extras, it may be desired to mirror just cobbler and koan, and skip all of the game packages. To do this, use --rpm-list="cobbler koan".
@@ -350,6 +339,10 @@ Specifies the priority of the repository (the lower the number, the higher the p
Specifies what architecture the repository should use. By default the current system arch (of the server) is used, which may not be desirable. Using this to override the default arch allows mirroring of source repositories (using --arch=src).
+=item yumopts
+
+Sets values for additional yum options that the repo should use on installed systems. For instance if a yum plugin takes a certain parameter "alpha" and "beta", use something like --yumopts="alpha=2 beta=3".
+
=back
=head2 DISPLAYING CONFIGURATION ENTRIES
diff --git a/webui_templates/repo_edit.tmpl b/webui_templates/repo_edit.tmpl
index 17ca4ec..445218f 100644
--- a/webui_templates/repo_edit.tmpl
+++ b/webui_templates/repo_edit.tmpl
@@ -150,6 +150,19 @@ function disablename(value)
</td>
</tr>
+ <tr>
+ <td>
+ <label for="yumopts">yum options</label>
+ </td>
+ <td>
+ <input type="text" size="255" style="width: 150px;" name="yumopts" id="yumopts"
+ #if $repo
+ value="$repo.yumopts"
+ #end if
+ />
+ <p class="context-tip">Sets specific yum plugin parameters on the installed system.</p>
+ </td>
+ </tr>
#if $repo
diff --git a/webui_templates/repo_list.tmpl b/webui_templates/repo_list.tmpl
index f28369b..26dd1a1 100644
--- a/webui_templates/repo_list.tmpl
+++ b/webui_templates/repo_list.tmpl
@@ -29,7 +29,7 @@
<tr class="$tr_class">
<td>
- <a href="$base_url/repo_edit?name=$repo.name">$repo.name</a>
+ <a href="$base_url/?mode=repo_edit&name=$repo.name">$repo.name</a>
</td>
<td>$repo.mirror</td>
</tr>