Skip to content

Commit

Permalink
Merge pull request #19 from cameron-jack/master
Browse files Browse the repository at this point in the history
UUID checking to avoid duplicate workflows
  • Loading branch information
afgane committed Feb 5, 2016
2 parents dd14443 + 27e9c78 commit d2f157c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion files/install_workflow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import argparse
from bioblend import galaxy
import json

def main():
"""
Expand All @@ -17,8 +18,13 @@ def main():
help="Galaxy admin user API key (required if not "
"defined in the tools list file)",)
args = parser.parse_args()

gi = galaxy.GalaxyInstance(url=args.galaxy_url, key=args.api_key)
gi.workflows.import_workflow_from_local_path(args.workflow_path)

import_uuid = json.load(open(args.workflow_path, 'r'))['uuid']
existing_uuids = [d['latest_workflow_uuid'] for d in gi.workflows.get_workflows()]
if import_uuid not in existing_uuids:
gi.workflows.import_workflow_from_local_path(args.workflow_path)

if __name__ == '__main__':
main()

0 comments on commit d2f157c

Please sign in to comment.