diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-08-27 10:41:03 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-08-27 10:43:25 -0400 |
commit | af363ce540bd2510e06d55b53b39010df69037de (patch) | |
tree | d9102b31ac00804bb90b0ebee1b92ab68644614d /src/lib/Bcfg2/Server/Plugins | |
parent | 935ff8b432af9a62002993e3e4c7bb789506fc29 (diff) | |
download | bcfg2-af363ce540bd2510e06d55b53b39010df69037de.tar.gz bcfg2-af363ce540bd2510e06d55b53b39010df69037de.tar.bz2 bcfg2-af363ce540bd2510e06d55b53b39010df69037de.zip |
Packages: added support for generating Apt sources.list
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Packages/Apt.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Apt.py b/src/lib/Bcfg2/Server/Plugins/Packages/Apt.py index 06730562a..d182453e6 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Apt.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Apt.py @@ -10,6 +10,21 @@ class AptCollection(Collection): "supported by APT") return [] + def get_config(self): + lines = ["# This config was generated automatically by the Bcfg2 " \ + "Packages plugin", ''] + + sources = dict() + for source in self.sources: + if source.rawurl: + self.logger.info("Packages: Skipping rawurl %s" % source.rawurl) + else: + lines.append("deb %s %s %s" % (source.url, source.version, + " ".join(source.components))) + lines.append("") + + return "\n".join(lines) + class AptSource(Source): basegroups = ['apt', 'debian', 'ubuntu', 'nexenta'] |