diff options
-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.''' |