From 18c024d69b373af53398157c658bcd2265d5d9c0 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 1 Mar 2013 01:07:05 +0100 Subject: Packages: Add 'pin' attribute --- schemas/packages.xsd | 9 +++++++++ src/lib/Bcfg2/Server/Plugins/Packages/Source.py | 7 +++++-- 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 @@ + + + + Extra information for pinning. This information is used + to differ between the sources. Should be used in the + supported format of apt. + + + diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py index b2422d84e..2b7514b06 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py @@ -198,6 +198,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` @@ -261,12 +264,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: -- cgit v1.2.3-1-g7c22