#!/usr/bin/python
import sys
+from datetime import datetime
from sfa.util.xrn import get_authority, hrn_to_urn
from sfa.generic import Generic
else:
self.logger = _SfaLogger(logfile='/var/log/sfa_import.log', loggername='importlog')
self.logger.setLevelFromOptVerbose(self.config.SFA_API_LOGLEVEL)
+# ugly side effect so that other modules get it right
+ import sfa.util.sfalogging
+ sfa.util.sfalogging.logger=logger
# self.TrustedRoots = TrustedRoots(self.config.get_trustedroots_dir())
# check before creating a RegRecord entry as we run this over and over
generic=Generic.the_flavour()
importer_class = generic.importer_class()
if importer_class:
- self.logger.info ("Using flavour %s for importing (class %s)"%\
- (generic.flavour,importer_class.__name__))
+ begin_time=datetime.now()
+ self.logger.info ("Starting import on %s, using class %s from flavour %s"%\
+ (begin_time,importer_class.__name__,generic.flavour))
testbed_importer = importer_class (auth_hierarchy, self.logger)
if testbed_importer:
testbed_importer.add_options(options)
testbed_importer.run (options)
+ end_time=datetime.now()
+ duration=end_time-begin_time
+ self.logger.info("Import took %s"%duration)