Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Little bug fixes and other minor improvements. #182

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion synda/sdt/sddaemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion synda/sdt/sddatasetutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
7 changes: 6 additions & 1 deletion synda/sdt/sdenqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
11 changes: 8 additions & 3 deletions synda/sdt/sdfiledao.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion synda/sdt/sdhistory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions synda/sdt/sdmyproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
Expand Down