1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/af8f5887b977/ changeset: af8f5887b977 user: greg date: 2011-11-22 23:09:14 summary: Fixes for Galaxy / tool shed communication. affected #: 2 files diff -r 9d6a9963b0da21fe3139fcefbd11c1ec6290a529 -r af8f5887b97768777be91dab8df40bbcd8b8d3c8 lib/galaxy/web/controllers/admin.py --- a/lib/galaxy/web/controllers/admin.py +++ b/lib/galaxy/web/controllers/admin.py @@ -774,21 +774,21 @@ @web.require_admin def find_tools_in_tool_shed( self, trans, **kwd ): tool_shed_url = kwd[ 'tool_shed_url' ] - galaxy_url = trans.request.host + galaxy_url = url_for( '', qualified=True ) url = '%s/repository/find_tools?galaxy_url=%s&webapp=galaxy' % ( tool_shed_url, galaxy_url ) return trans.response.send_redirect( url ) @web.expose @web.require_admin def find_workflows_in_tool_shed( self, trans, **kwd ): tool_shed_url = kwd[ 'tool_shed_url' ] - galaxy_url = trans.request.host + galaxy_url = url_for( '', qualified=True ) url = '%s/repository/find_workflows?galaxy_url=%s&webapp=galaxy' % ( tool_shed_url, galaxy_url ) return trans.response.send_redirect( url ) @web.expose @web.require_admin def browse_tool_shed( self, trans, **kwd ): tool_shed_url = kwd[ 'tool_shed_url' ] - galaxy_url = trans.request.host + galaxy_url = url_for( '', qualified=True ) url = '%s/repository/browse_valid_repositories?galaxy_url=%s&webapp=galaxy' % ( tool_shed_url, galaxy_url ) return trans.response.send_redirect( url ) @web.expose @@ -986,11 +986,10 @@ @web.expose @web.require_admin def check_for_updates( self, trans, **kwd ): - params = util.Params( kwd ) repository = get_repository( trans, kwd[ 'id' ] ) - galaxy_url = trans.request.host + galaxy_url = url_for( '', qualified=True ) # Send a request to the relevant tool shed to see if there are any updates. - # TODO: support https in the following url. + # TODO: Fix this to use url_for to support locally hosted tool sheds. url = 'http://%s/repository/check_for_updates?galaxy_url=%s&name=%s&owner=%s&changeset_revision=%s&webapp=galaxy' % \ ( repository.tool_shed, galaxy_url, repository.name, repository.owner, repository.changeset_revision ) return trans.response.send_redirect( url ) @@ -1215,7 +1214,7 @@ module = __import__( import_module ) sys.path.pop( 0 ) except Exception, e: - log.debug( "Execption importing datatypes code file included in installed repository: %s" % str( e ) ) + log.debug( "Exception importing datatypes code file included in installed repository: %s" % str( e ) ) trans.app.datatypes_registry = galaxy.datatypes.registry.Registry( trans.app.config.root, datatypes_config ) def __get_repository_tools_and_sample_files( self, trans, tool_path, repo_files_dir ): # The sample_files list contains all files whose name ends in .sample @@ -1398,10 +1397,11 @@ trans.model.ToolShedRepository.table.c.changeset_revision == changeset_revision ) ) \ .first() def get_repository_by_shed_name_owner_changeset_revision( trans, tool_shed, name, owner, changeset_revision ): + if tool_shed.find( '//' ) > 0: + tool_shed = tool_shed.split( '//' )[1] return trans.sa_session.query( trans.model.ToolShedRepository ) \ .filter( and_( trans.model.ToolShedRepository.table.c.tool_shed == tool_shed, trans.model.ToolShedRepository.table.c.name == name, trans.model.ToolShedRepository.table.c.owner == owner, trans.model.ToolShedRepository.table.c.changeset_revision == changeset_revision ) ) \ .first() - diff -r 9d6a9963b0da21fe3139fcefbd11c1ec6290a529 -r af8f5887b97768777be91dab8df40bbcd8b8d3c8 lib/galaxy/webapps/community/controllers/repository.py --- a/lib/galaxy/webapps/community/controllers/repository.py +++ b/lib/galaxy/webapps/community/controllers/repository.py @@ -437,9 +437,8 @@ if operation == "install": galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' ) encoded_repo_info_dict = self.__encode_repo_info_dict( trans, webapp, util.listify( item_id ) ) - # TODO: support https in the following url. - url = 'http://%s/admin/install_tool_shed_repository?tool_shed_url=%s&webapp=%s&repo_info_dict=%s' % \ - ( galaxy_url, trans.request.host, webapp, encoded_repo_info_dict ) + url = '%s/admin/install_tool_shed_repository?tool_shed_url=%s&webapp=%s&repo_info_dict=%s' % \ + ( galaxy_url, url_for( '', qualified=True ), webapp, encoded_repo_info_dict ) return trans.response.send_redirect( url ) else: # This can only occur when there is a multi-select grid with check boxes and an operation, @@ -514,9 +513,8 @@ if operation == "install": galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' ) encoded_repo_info_dict = self.__encode_repo_info_dict( trans, webapp, util.listify( item_id ) ) - # TODO: support https in the following url. - url = 'http://%s/admin/install_tool_shed_repository?tool_shed_url=%s&webapp=%s&repo_info_dict=%s' % \ - ( galaxy_url, trans.request.host, webapp, encoded_repo_info_dict ) + url = '%s/admin/install_tool_shed_repository?tool_shed_url=%s&webapp=%s&repo_info_dict=%s' % \ + ( galaxy_url, url_for( '', qualified=True ), webapp, encoded_repo_info_dict ) return trans.response.send_redirect( url ) else: # This can only occur when there is a multi-select grid with check boxes and an operation, @@ -761,9 +759,8 @@ repo_info_dict[ repository.name ] = ( repository.description, repository_clone_url, changeset_revision ) encoded_repo_info_dict = encode( repo_info_dict ) # Redirect back to local Galaxy to perform install. - # TODO: support https in the following url. - url = 'http://%s/admin/install_tool_shed_repository?tool_shed_url=%s&repo_info_dict=%s' % \ - ( galaxy_url, trans.request.host, encoded_repo_info_dict ) + url = '%s/admin/install_tool_shed_repository?tool_shed_url=%s&repo_info_dict=%s' % \ + ( galaxy_url, url_for( '', qualified=True ), encoded_repo_info_dict ) return trans.response.send_redirect( url ) @web.expose def check_for_updates( self, trans, **kwd ): @@ -776,8 +773,7 @@ changeset_revision = params.get( 'changeset_revision', None ) webapp = params.get( 'webapp', 'community' ) # Start building up the url to redirect back to the calling Galaxy instance. - # TODO: support https in the following url. - url = 'http://%s/admin/update_to_changeset_revision?tool_shed_url=%s' % ( galaxy_url, trans.request.host ) + url = '%s/admin/update_to_changeset_revision?tool_shed_url=%s' % ( galaxy_url, url_for( '', qualified=True ) ) repository = get_repository_by_name_and_owner( trans, name, owner ) url += '&name=%s&owner=%s&changeset_revision=%s&latest_changeset_revision=' % \ ( repository.name, repository.user.username, changeset_revision ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.