diff --git a/synda/sdt/sddaemon.py b/synda/sdt/sddaemon.py index 6b84fee6..59983549 100755 --- a/synda/sdt/sddaemon.py +++ b/synda/sdt/sddaemon.py @@ -64,7 +64,7 @@ def main_loop(config_manager): try: sdtaskscheduler.event_loop(config_manager) - except SDException as e: + except Exception as e: level = preferences.log_verbosity_level diff --git a/synda/sdt/sddatasetutils.py b/synda/sdt/sddatasetutils.py index a88b3566..4f8cef26 100755 --- a/synda/sdt/sddatasetutils.py +++ b/synda/sdt/sddatasetutils.py @@ -27,7 +27,7 @@ def get_old_versions_datasets(): if not datasetVersions.is_version_higher_than_latest(d): # version is not higher than latest # assert if datasetVersions.is_most_recent_version_number(d): # should never occurs because of the previous tests - raise SDException("SDSTAT-042","fatal error (version=%s,path_without_version=%s)"%(d.version,d.get_name_without_version())) + raise SDException("SDSTAT-042","fatal error (version=%s,path_without_version=%s)"%(d.version,d.path_without_version())) lst.append(d) diff --git a/synda/sdt/sdenqueue.py b/synda/sdt/sdenqueue.py index df3dc66b..322f7e5d 100755 --- a/synda/sdt/sdenqueue.py +++ b/synda/sdt/sdenqueue.py @@ -146,7 +146,12 @@ def keep_recent_datasets(datasets): for d in datasets: - if 'last_mode_date' in list(d.__dict__.keys()): + if not hasattr(d,'last_mod_date') or d.last_mod_date is None: + # probably imported from another database missing last_mod_date. + # But certainly it wasn't modified in the last 24 hours. + # And an interval calculation won't work with None. + pass + else: interval = sdtime.compute_time_delta( d.last_mod_date, sdtime.now(), diff --git a/synda/sdt/sdfiledao.py b/synda/sdt/sdfiledao.py index 79cf8765..95875e86 100755 --- a/synda/sdt/sdfiledao.py +++ b/synda/sdt/sdfiledao.py @@ -105,9 +105,14 @@ def get_file(file_functional_id,conn=sddb.conn): """ t=None - c = conn.cursor() - c.execute("select * from file where file_functional_id = ?", (file_functional_id,)) - rs=c.fetchone() + try: + c = conn.cursor() + c.execute("select * from file where file_functional_id = ?", (file_functional_id,)) + rs=c.fetchone() + except: + sdlog.info("SDFILDAO-100","get_file exception %s, file_functional_id %s" % + (e, file_functional_id) ) + raise e if rs is not None: t=sdsqlutils.get_object_from_resultset(rs,File) c.close() diff --git a/synda/sdt/sdhistory.py b/synda/sdt/sdhistory.py index e4b3fb0c..0d860713 100755 --- a/synda/sdt/sdhistory.py +++ b/synda/sdt/sdhistory.py @@ -52,7 +52,7 @@ def file_changed_since_last_run(selection_file, action): previous_run = get_previous_run(selection_filename, action) previous_checksum = previous_run['selection_file_checksum'] - return previous_checksum == current_checksum + return previous_checksum != current_checksum def add_history_line(action=None, selection_file=None, insertion_group_id=None, crea_date=None): diff --git a/synda/sdt/sdmyproxy.py b/synda/sdt/sdmyproxy.py index 909dbea0..cedba59c 100755 --- a/synda/sdt/sdmyproxy.py +++ b/synda/sdt/sdmyproxy.py @@ -187,7 +187,7 @@ def renew_certificate(host, port, username, password): parser = argparse.ArgumentParser() - parser.add_argument('--host', '-h', default='pcmdi9.llnl.gov') + parser.add_argument('--host', '-h', default='esgf-node.llnl.gov') parser.add_argument('--port', '-p', type=int, default=7512) parser.add_argument( '--force_renew_certificate', @@ -206,7 +206,7 @@ def renew_certificate(host, port, username, password): args = parser.parse_args() run( - args.hostname, + args.host, args.port, args.username, args.force_renew_certificate,