From: Tony Mack Date: Tue, 17 Aug 2010 18:00:43 +0000 (+0000) Subject: make sure to honor the xrn argument X-Git-Tag: sfa-1.0-0~38 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=4bb1c793ec2432c454ec91d55d1a819a61ec9ede make sure to honor the xrn argument --- diff --git a/sfa/methods/get_aggregates.py b/sfa/methods/get_aggregates.py index 0ed15f34..c9609744 100644 --- a/sfa/methods/get_aggregates.py +++ b/sfa/methods/get_aggregates.py @@ -30,5 +30,7 @@ class get_aggregates(Method): def call(self, cred, xrn = None): hrn, type = urn_to_hrn(xrn) self.api.auth.check(cred, 'list') - aggregates = Aggregates(self.api) - return aggregates.interfaces.values() + aggregates = Aggregates(self.api).interfaces.values() + if hrn: + aggregates = [agg for agg in aggregates if agg['hrn'] == hrn] + return aggregates