diff options
author | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2015-01-07 16:23:39 +0000 |
---|---|---|
committer | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2015-01-07 16:23:39 +0000 |
commit | 9160e609588e1a7f60385abb1193f5ac8d08d12f (patch) | |
tree | fc48e14bc46ae43918acbd07d722421f7c10383c | |
parent | 12ec2e4efe868d990076ed8b4e7376c3e808b38e (diff) | |
download | import-9160e609588e1a7f60385abb1193f5ac8d08d12f.tar.gz |
Fix
Not taking into account kinds for the moment
-rw-r--r-- | baserockimport/lorryset.py | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/baserockimport/lorryset.py b/baserockimport/lorryset.py index 8cc73af..eab3f47 100644 --- a/baserockimport/lorryset.py +++ b/baserockimport/lorryset.py @@ -108,22 +108,9 @@ class LorrySet(object): return {name: self.data[name]} def find_lorry_for_package(self, kind, package_name): - '''Find the lorry entry for a given foreign package, or return None. + '''Find the lorry entry for a given package, or return None.''' - This makes use of an extension to the .lorry format made by the - Baserock Import tool. Fields follow the form 'x-products-$KIND' - and specify the name of a package in the foreign packaging universe - named $KIND. - - ''' - key = 'x-products-%s' % kind - for name, lorry in self.data.iteritems(): - products = lorry.get(key, []) - for entry in products: - if entry == package_name: - return {name: lorry} - - return None + return self.data[package_name] if package_name in self.data else None def _check_for_conflicts_in_standard_fields(self, existing, new): '''Ensure that two lorries for the same project do actually match.''' |