From 52486baf334848ce9af3df4245102f60b73e987c Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Mon, 27 Nov 2006 16:09:56 +0000 Subject: [PATCH] - remove invalid (i.e. expired) slice_ids from from node['slice_ids'] --- PLC/Methods/GetSlivers.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PLC/Methods/GetSlivers.py b/PLC/Methods/GetSlivers.py index ace99c55..9f312d79 100644 --- a/PLC/Methods/GetSlivers.py +++ b/PLC/Methods/GetSlivers.py @@ -144,15 +144,17 @@ class GetSlivers(Method): if conf_file_id in all_conf_files: conf_files[conf_file['dest']] = all_conf_files[conf_file_id] - slice_ids = dict.fromkeys(node['slice_ids']) + # filter out any slices in this nodes slice_id list that may be invalid + # (i.e. expired slices) + slice_ids = dict.fromkeys([slice['slice_id'] for slice in Slices(self.api, node['slice_ids'])]) # If not a foreign node, add all of our default system # slices to it. if node['peer_id'] is not None: slice_ids.update(system_slice_ids) - slivers = [] - for slice in map(lambda id: all_slices[id], slice_ids.keys()): + slivers = [] + for slice in map(lambda id: all_slices[id], slice_ids.keys()): keys = [] ### still missing in foreign slices try: -- 2.47.0