galaxy-dist commit 243d80d9905a: adding setup_rabbitmq.sh script.
# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User rc # Date 1288197416 14400 # Node ID 243d80d9905af9121452f1a0955b2b49c076d66e # Parent 9c6040ab75a8397a5708cfec4edfe216927b8220 adding setup_rabbitmq.sh script. web api minor code fixes --- a/scripts/api/common.py +++ b/scripts/api/common.py @@ -91,7 +91,10 @@ def submit( api_key, url, data, return_f except urllib2.HTTPError, e: print e print e.read( 1024 ) - sys.exit( 1 ) + if return_formatted: + sys.exit( 1 ) + else: + return 'Error. '+ str( e ) if not return_formatted: return r print 'Response' --- /dev/null +++ b/setup_rabbitmq.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +cd `dirname $0` +python scripts/galaxy_messaging/server/setup_rabbitmq.py universe_wsgi.ini --- a/scripts/galaxy_messaging/server/data_transfer.py +++ b/scripts/galaxy_messaging/server/data_transfer.py @@ -184,10 +184,11 @@ class DataTransfer(object): url = "http://%s:%s/api/libraries/%s/contents" % ( self.server_host, self.server_port, api.encode_id( self.config_id_secret, self.library_id ) ) - log.debug(str((self.api_key, url, data))) + log.debug( str( ( self.api_key, url, data ) ) ) retval = api.submit( self.api_key, url, data, return_formatted=False ) - except: - self.error_and_exit(str(e)) + log.debug( str( retval ) ) + except Exception, e: + self.error_and_exit( str( e ) ) def update_status(self, status, dataset_id='All', msg=''): ''' @@ -212,7 +213,7 @@ class DataTransfer(object): api.encode_id( self.config_id_secret, self.request_id ) ) log.debug(str((self.api_key, url, data))) retval = api.update( self.api_key, url, data, return_formatted=False ) - log.debug('done.') + log.debug( str( retval ) ) except urllib2.URLError, e: log.debug( 'ERROR(sample_dataset_transfer_status (%s)): %s' % ( url, str(e) ) ) log.error(traceback.format_exc()) --- a/scripts/galaxy_messaging/server/setup_rabbitmq.py +++ b/scripts/galaxy_messaging/server/setup_rabbitmq.py @@ -11,13 +11,17 @@ import os, sys, csv, ConfigParser def main( config_file ): - config = ConfigParser.ConfigParser() - config.read( config_file ) - rabbitmqctl_path = config.get( 'galaxy_amqp', 'rabbitmqctl_path' ) - username = config.get( 'galaxy_amqp', 'userid' ) - password = config.get( 'galaxy_amqp', 'password' ) - virtual_host = config.get( 'galaxy_amqp', 'virtual_host' ) - + try: + config = ConfigParser.ConfigParser() + config.read( config_file ) + rabbitmqctl_path = config.get( 'galaxy_amqp', 'rabbitmqctl_path' ) + username = config.get( 'galaxy_amqp', 'userid' ) + password = config.get( 'galaxy_amqp', 'password' ) + virtual_host = config.get( 'galaxy_amqp', 'virtual_host' ) + except Exception, e: + print 'Fatal error:', str(e) + sys.exit(1) + cmd_list = [ 'add_user %s %s' % ( username, password ), 'add_vhost %s' % config.get( 'galaxy_amqp', 'virtual_host' ),
participants (1)
-
commits-noreply@bitbucket.org