summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-03-01 01:07:05 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2018-10-18 16:19:07 +0200
commit0d27176a62017648ce453befa152ca80e48ec018 (patch)
treeb415670b04b4791fcd1a798da85601f9bd818257
parent447467a9935bd5b4f9f0e0421c129e3130ca0635 (diff)
downloadbcfg2-0d27176a62017648ce453befa152ca80e48ec018.tar.gz
bcfg2-0d27176a62017648ce453befa152ca80e48ec018.tar.bz2
bcfg2-0d27176a62017648ce453befa152ca80e48ec018.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.py7
2 files changed, 14 insertions, 2 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 7cb511756..cc52487b8 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
@@ -191,6 +191,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`
@@ -254,12 +257,12 @@ 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,
arch=arch, debsrc=self.debsrc,
- priority=self.priority)]
+ priority=self.priority, pin=self.pin)]
for setting in usettings:
if not self.rawurl: