summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-03-01 01:07:05 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2015-05-10 16:25:26 +0200
commita421270df079eebb4365375e3a39693a21b3a221 (patch)
treeb1f54e2ce2ef7bc670aecd51c419bdb4bfa6680e
parentd0749e064eb309fec44ed13ef50bbb6ae1ddd3b4 (diff)
downloadbcfg2-a421270df079eebb4365375e3a39693a21b3a221.tar.gz
bcfg2-a421270df079eebb4365375e3a39693a21b3a221.tar.bz2
bcfg2-a421270df079eebb4365375e3a39693a21b3a221.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 847e58ba6..12435c2c8 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,