From 4b728f171202c2a0432aedb15e45a1d33f7f48ee Mon Sep 17 00:00:00 2001 From: Sandrine Avakian <sandrine.avakian@inria.fr> Date: Mon, 11 Mar 2013 10:25:16 +0100 Subject: [PATCH] Minor fix in slabimport. --- sfa/importer/slabimporter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sfa/importer/slabimporter.py b/sfa/importer/slabimporter.py index a35489c0..e66f083a 100644 --- a/sfa/importer/slabimporter.py +++ b/sfa/importer/slabimporter.py @@ -68,7 +68,10 @@ class SlabImporter: #retrieve all existing SFA objects all_records = dbsession.query(RegRecord).all() - + + # initialize record.stale to True by default, then mark stale=False on the ones that are in use + for record in all_records: + record.stale = True #create hash by (type,hrn) #used to know if a given record is already known to SFA @@ -82,9 +85,6 @@ class SlabImporter: self.records_by_type_pointer = \ dict ( [ ( (str(record.type),record.pointer) , record ) for record in all_records if record.pointer != -1] ) - # initialize record.stale to True by default, then mark stale=False on the ones that are in use - for record in all_records: - record.stale = True nodes_listdict = slabdriver.slab_api.GetNodes() nodes_by_id = dict([(node['node_id'],node) for node in nodes_listdict]) @@ -340,7 +340,7 @@ class SlabImporter: print>>sys.stderr,"SlabImporter: stale records: hrn %s %s" \ %(record.hrn,record.stale) try: - stale=record.stale + stale = record.stale except: stale=True self.logger.warning("stale not found with %s"%record) -- 2.47.0