Skip to content

Instantly share code, notes, and snippets.

@jmchilton
Created March 5, 2012 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmchilton/1979583 to your computer and use it in GitHub Desktop.
Save jmchilton/1979583 to your computer and use it in GitHub Desktop.
Example preseed script
# Place this file (preseed.py) in your galaxy directory and run it via
# python preseed.py
from scripts.db_shell import *
admin_user = User("admin@localhost")
admin_user.set_password_cleartext("test1")
sa_session.add(admin_user)
sa_session.flush()
user = User("user@localhost")
user.set_password_cleartext("test2")
sa_session.add(user)
sa_session.flush()
admin_key = APIKeys()
admin_key.user_id = admin_user.id
print 'Setting admin id as %s' % admin_user.id
admin_key.key = '123323424134523451342'
sa_session.add( admin_key )
sa_session.flush()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment