summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Packages/Source.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-23 10:47:13 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-23 10:47:13 -0400
commit4c4534c2302c869f5f8258eb7107dcf531e0edc7 (patch)
tree42c98b2d2540f93d32a389dce7b9ce6b116bccdd /src/lib/Server/Plugins/Packages/Source.py
parentff5f8989262f9c3c449bd68b459fec8e955f34c9 (diff)
downloadbcfg2-4c4534c2302c869f5f8258eb7107dcf531e0edc7.tar.gz
bcfg2-4c4534c2302c869f5f8258eb7107dcf531e0edc7.tar.bz2
bcfg2-4c4534c2302c869f5f8258eb7107dcf531e0edc7.zip
added ability to specify arbitrary repository options to Packages
Diffstat (limited to 'src/lib/Server/Plugins/Packages/Source.py')
-rw-r--r--src/lib/Server/Plugins/Packages/Source.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/Packages/Source.py b/src/lib/Server/Plugins/Packages/Source.py
index 88d47fb3e..627ff561d 100644
--- a/src/lib/Server/Plugins/Packages/Source.py
+++ b/src/lib/Server/Plugins/Packages/Source.py
@@ -49,7 +49,18 @@ class Source(Bcfg2.Server.Plugin.Debuggable):
for key, tag in [('components', 'Component'), ('arches', 'Arch'),
('blacklist', 'Blacklist'),
('whitelist', 'Whitelist')]:
- self.__dict__[key] = [item.text for item in xsource.findall(tag)]
+ setattr(self, key, [item.text for item in xsource.findall(tag)])
+ self.server_options = dict()
+ self.client_options = dict()
+ opts = xsource.findall("Options")
+ for el in opts:
+ repoopts = dict([(k, v)
+ for k, v in el.attrib.items()
+ if k != "clientonly" and k != "serveronly"])
+ if el.get("clientonly", "false").lower() == "false":
+ self.server_options.update(repoopts)
+ if el.get("serveronly", "false").lower() == "false":
+ self.client_options.update(repoopts)
self.gpgkeys = [el.text for el in xsource.findall("GPGKey")]