From: Barış Metin Date: Tue, 7 Sep 2010 13:21:04 +0000 (+0000) Subject: filter-out tags and fields from GetSliceTags plcapi call. X-Git-Tag: sfa-1.0-0~3 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ad8023008c7906fcfa08cc402c2c931f798c8aea;hp=4d17883d9210a0bee2572d7c237e2e40d1e66b5c;p=sfa.git filter-out tags and fields from GetSliceTags plcapi call. On PLE, this brings the call to 3 seconds from 45 seconds. --- diff --git a/sfa/plc/network.py b/sfa/plc/network.py index 3b16226f..04daa50d 100644 --- a/sfa/plc/network.py +++ b/sfa/plc/network.py @@ -198,6 +198,9 @@ class Slice: class Slicetag: newid = -1 + filter_fields = ['slice_tag_id','slice_id','tagname','value','node_id','category','min_role_id'] + ignore_tags = ['hmac','ssh_key'] + def __init__(self, tag = None): if not tag: return @@ -538,7 +541,7 @@ class Network: Create a dictionary of slicetag objects keyed by slice tag ID """ tmp = [] - for tag in api.plshell.GetSliceTags(self.user_plauth): + for tag in api.plshell.GetSliceTags(self.user_plauth, {'~tagname':Slicetag.ignore_tags}, Slicetag.filter_fields): t = tag['slice_tag_id'], Slicetag(tag) tmp.append(t) return dict(tmp)