Skip to content

Conversation

@corviday
Copy link
Contributor

@corviday corviday commented Jun 6, 2018

Script was written to copy all files from from one metadata ensemble in the database to another. Seems like it might be useful again someday.

Copy link

@rod-glover rod-glover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, apart from a couple of very minor items.

try:
logger.info("Generating list of files associated with ensemble {}".format(args.source))
session = Session()
source_ensemble = find_ensemble(session, args.source, 1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source_ensemble isn't used anywhere. Is it just to verify that the ensemble exists? If so, that may not really be necessary.

filenames.append(f.filename)
except:
logger.error(traceback.format_exc())
session.rollback()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're only doing selects (which you are), rollback isn't necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants