summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-03-01 01:07:05 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2014-11-10 19:56:35 +0100
commite710abbfec4c7fbb68f2e3a60589c7f38bafeaae (patch)
tree88b44cad981f1a986e77b571c58ff533f8878768
parent1d4c536f4a7c3319aedbceb0c6488ef47fc61388 (diff)
downloadbcfg2-e710abbfec4c7fbb68f2e3a60589c7f38bafeaae.tar.gz
bcfg2-e710abbfec4c7fbb68f2e3a60589c7f38bafeaae.tar.bz2
bcfg2-e710abbfec4c7fbb68f2e3a60589c7f38bafeaae.zip
Packages/Apt: add pin attribute for extra pinning information
-rw-r--r--schemas/packages.xsd9
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/Source.py5
2 files changed, 13 insertions, 1 deletions
diff --git a/schemas/packages.xsd b/schemas/packages.xsd
index 3f2fe4f57..d358a17b3 100644
--- a/schemas/packages.xsd
+++ b/schemas/packages.xsd
@@ -235,6 +235,15 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
+ <xsd:attribute type="xsd:string" name="pin">
+ <xsd:annotation>
+ <xsd:documentation>
+ Extra information for pinning. This information is used
+ to differ between the sources. Should be used in the
+ supported format of apt.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
<xsd:attributeGroup ref="py:genshiAttrs"/>
</xsd:complexType>
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
index 1d053fc34..39e01c0bc 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
@@ -205,6 +205,9 @@ class Source(Debuggable): # pylint: disable=R0902
#: The "priority" attribute from :attr:`xsource`
self.priority = xsource.get('priority', 500)
+ #: The "pin" attribute from :attr:`xsource`
+ self.pin = xsource.get('pin', '')
+
#: A list of predicates that are used to determine if this
#: source applies to a given
#: :class:`Bcfg2.Server.Plugins.Metadata.ClientMetadata`
@@ -281,7 +284,7 @@ class Source(Debuggable): # pylint: disable=R0902
if self.url:
usettings = [dict(version=self.version, component=comp,
arch=arch, debsrc=self.debsrc,
- priority=self.priority)
+ priority=self.priority, pin=self.pin)
for comp in self.components]
else: # rawurl given
usettings = [dict(version=self.version, component=None,