2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/bdff5a8cc4b9/ Changeset: bdff5a8cc4b9 Branch: next-stable User: greg Date: 2014-05-27 19:32:49 Summary: Improve exception handling for generated Tool Shed URLs. Affected #: 4 files diff -r 2cab30fd7436a0e38bb3d60eea5b5fa929f62244 -r bdff5a8cc4b91ec6deff722884bde7357e67e6ef lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -383,6 +383,11 @@ """ repository = suc.get_installed_tool_shed_repository( trans, repository_id ) tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( trans.app, str( repository.tool_shed ) ) + if tool_shed_url is None or repository_name is None or repository_owner is None or changeset_revision is None: + message = "Unable to retrieve tool dependencies from the Tool Shed because one or more of the following required " + message += "parameters is None: tool_shed_url: %s, repository_name: %s, repository_owner: %s, changeset_revision: %s " % \ + ( str( tool_shed_url ), str( repository_name ), str( repository_owner ), str( changeset_revision ) ) + raise Exception( message ) params = '?name=%s&owner=%s&changeset_revision=%s' % ( repository_name, repository_owner, changeset_revision ) url = common_util.url_join( tool_shed_url, 'repository/get_tool_dependencies%s' % params ) @@ -403,6 +408,11 @@ """ repository = suc.get_installed_tool_shed_repository( trans, repository_id ) tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( trans.app, str( repository.tool_shed ) ) + if tool_shed_url is None or repository_name is None or repository_owner is None or changeset_revision is None: + message = "Unable to retrieve updated repository information from the Tool Shed because one or more of the following " + message += "required parameters is None: tool_shed_url: %s, repository_name: %s, repository_owner: %s, changeset_revision: %s " % \ + ( str( tool_shed_url ), str( repository_name ), str( repository_owner ), str( changeset_revision ) ) + raise Exception( message ) params = '?name=%s&owner=%s&changeset_revision=%s' % ( str( repository_name ), str( repository_owner ), changeset_revision ) diff -r 2cab30fd7436a0e38bb3d60eea5b5fa929f62244 -r bdff5a8cc4b91ec6deff722884bde7357e67e6ef lib/tool_shed/galaxy_install/tool_dependencies/recipe/tag_handler.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/tag_handler.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/tag_handler.py @@ -161,6 +161,11 @@ def create_temporary_tool_dependencies_config( self, app, tool_shed_url, name, owner, changeset_revision ): """Make a call to the tool shed to get the required repository's tool_dependencies.xml file.""" tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( app, tool_shed_url ) + if tool_shed_url is None or name is None or owner is None or changeset_revision is None: + message = "Unable to retrieve required tool_dependencies.xml file from the Tool Shed because one or more of the " + message += "following required parameters is None: tool_shed_url: %s, name: %s, owner: %s, changeset_revision: %s " % \ + ( str( tool_shed_url ), str( name ), str( owner ), str( changeset_revision ) ) + raise Exception( message ) params = '?name=%s&owner=%s&changeset_revision=%s' % ( name, owner, changeset_revision ) url = common_util.url_join( tool_shed_url, 'repository/get_tool_dependencies_config_contents%s' % params ) @@ -175,7 +180,7 @@ fh.close() return tmp_filename else: - message = "Unable to retrieve required tool_dependencies.xml file from the tool shed for revision " + message = "Unable to retrieve required tool_dependencies.xml file from the Tool Shed for revision " message += "%s of installed repository %s owned by %s." % ( str( changeset_revision ), str( name ), str( owner ) ) raise Exception( message ) return None diff -r 2cab30fd7436a0e38bb3d60eea5b5fa929f62244 -r bdff5a8cc4b91ec6deff722884bde7357e67e6ef lib/tool_shed/util/common_util.py --- a/lib/tool_shed/util/common_util.py +++ b/lib/tool_shed/util/common_util.py @@ -107,7 +107,7 @@ def generate_clone_url_for_installed_repository( app, repository ): """Generate the URL for cloning a repository that has been installed into a Galaxy instance.""" tool_shed_url = get_tool_shed_url_from_tool_shed_registry( app, str( repository.tool_shed ) ) - return url_join( tool_shed_url, 'repos', repository.owner, repository.name ) + return url_join( tool_shed_url, 'repos', str( repository.owner ), str( repository.name ) ) def generate_clone_url_for_repository_in_tool_shed( trans, repository ): """Generate the URL for cloning a repository that is in the tool shed.""" @@ -316,5 +316,6 @@ """Return a valid URL produced by appending a base URL and a set of request parameters.""" parts = [] for arg in args: - parts.append( arg.strip( '/' ) ) + if arg is not None: + parts.append( arg.strip( '/' ) ) return '/'.join( parts ) diff -r 2cab30fd7436a0e38bb3d60eea5b5fa929f62244 -r bdff5a8cc4b91ec6deff722884bde7357e67e6ef lib/tool_shed/util/shed_util_common.py --- a/lib/tool_shed/util/shed_util_common.py +++ b/lib/tool_shed/util/shed_util_common.py @@ -942,6 +942,11 @@ """ # This method is used only in Galaxy, not the Tool Shed. We store the port (if one exists) in the database. tool_shed = common_util.remove_protocol_from_tool_shed_url( tool_shed ) + if tool_shed is None or name is None or owner is None or changeset_revision is None: + message = "Unable to retrieve the repository record from the database because one or more of the following " + message += "required parameters is None: tool_shed: %s, name: %s, owner: %s, changeset_revision: %s " % \ + ( str( tool_shed ), str( name ), str( owner ), str( changeset_revision ) ) + raise Exception( message ) repository = get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app=app, tool_shed=tool_shed, name=name, @@ -1356,6 +1361,11 @@ the received tool_shed_url / name / owner combination. """ tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( app, tool_shed_url ) + if tool_shed_url is None or name is None or owner is None or changeset_revision is None: + message = "Unable to get updated changeset revisions from the Tool Shed because one or more of the following " + message += "required parameters is None: tool_shed_url: %s, name: %s, owner: %s, changeset_revision: %s " % \ + ( str( tool_shed_url ), str( name ), str( owner ), str( changeset_revision ) ) + raise Exception( message ) params = '?name=%s&owner=%s&changeset_revision=%s' % ( name, owner, changeset_revision ) url = common_util.url_join( tool_shed_url, 'repository/updated_changeset_revisions%s' % params ) https://bitbucket.org/galaxy/galaxy-central/commits/472fa62aaf72/ Changeset: 472fa62aaf72 User: greg Date: 2014-05-27 19:33:16 Summary: Merged next-stable Affected #: 4 files diff -r 44df8d9c9aa11acf796f88203551a92ac03c559d -r 472fa62aaf72a1b7c8a2520665efdc833d2ab5fc lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -377,6 +377,11 @@ """ repository = suc.get_installed_tool_shed_repository( trans, repository_id ) tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( trans.app, str( repository.tool_shed ) ) + if tool_shed_url is None or repository_name is None or repository_owner is None or changeset_revision is None: + message = "Unable to retrieve tool dependencies from the Tool Shed because one or more of the following required " + message += "parameters is None: tool_shed_url: %s, repository_name: %s, repository_owner: %s, changeset_revision: %s " % \ + ( str( tool_shed_url ), str( repository_name ), str( repository_owner ), str( changeset_revision ) ) + raise Exception( message ) params = '?name=%s&owner=%s&changeset_revision=%s' % ( repository_name, repository_owner, changeset_revision ) url = common_util.url_join( tool_shed_url, 'repository/get_tool_dependencies%s' % params ) @@ -397,6 +402,11 @@ """ repository = suc.get_installed_tool_shed_repository( trans, repository_id ) tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( trans.app, str( repository.tool_shed ) ) + if tool_shed_url is None or repository_name is None or repository_owner is None or changeset_revision is None: + message = "Unable to retrieve updated repository information from the Tool Shed because one or more of the following " + message += "required parameters is None: tool_shed_url: %s, repository_name: %s, repository_owner: %s, changeset_revision: %s " % \ + ( str( tool_shed_url ), str( repository_name ), str( repository_owner ), str( changeset_revision ) ) + raise Exception( message ) params = '?name=%s&owner=%s&changeset_revision=%s' % ( str( repository_name ), str( repository_owner ), changeset_revision ) diff -r 44df8d9c9aa11acf796f88203551a92ac03c559d -r 472fa62aaf72a1b7c8a2520665efdc833d2ab5fc lib/tool_shed/galaxy_install/tool_dependencies/recipe/tag_handler.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/tag_handler.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/tag_handler.py @@ -161,6 +161,11 @@ def create_temporary_tool_dependencies_config( self, app, tool_shed_url, name, owner, changeset_revision ): """Make a call to the tool shed to get the required repository's tool_dependencies.xml file.""" tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( app, tool_shed_url ) + if tool_shed_url is None or name is None or owner is None or changeset_revision is None: + message = "Unable to retrieve required tool_dependencies.xml file from the Tool Shed because one or more of the " + message += "following required parameters is None: tool_shed_url: %s, name: %s, owner: %s, changeset_revision: %s " % \ + ( str( tool_shed_url ), str( name ), str( owner ), str( changeset_revision ) ) + raise Exception( message ) params = '?name=%s&owner=%s&changeset_revision=%s' % ( name, owner, changeset_revision ) url = common_util.url_join( tool_shed_url, 'repository/get_tool_dependencies_config_contents%s' % params ) @@ -175,7 +180,7 @@ fh.close() return tmp_filename else: - message = "Unable to retrieve required tool_dependencies.xml file from the tool shed for revision " + message = "Unable to retrieve required tool_dependencies.xml file from the Tool Shed for revision " message += "%s of installed repository %s owned by %s." % ( str( changeset_revision ), str( name ), str( owner ) ) raise Exception( message ) return None diff -r 44df8d9c9aa11acf796f88203551a92ac03c559d -r 472fa62aaf72a1b7c8a2520665efdc833d2ab5fc lib/tool_shed/util/common_util.py --- a/lib/tool_shed/util/common_util.py +++ b/lib/tool_shed/util/common_util.py @@ -107,7 +107,7 @@ def generate_clone_url_for_installed_repository( app, repository ): """Generate the URL for cloning a repository that has been installed into a Galaxy instance.""" tool_shed_url = get_tool_shed_url_from_tool_shed_registry( app, str( repository.tool_shed ) ) - return url_join( tool_shed_url, 'repos', repository.owner, repository.name ) + return url_join( tool_shed_url, 'repos', str( repository.owner ), str( repository.name ) ) def generate_clone_url_for_repository_in_tool_shed( trans, repository ): """Generate the URL for cloning a repository that is in the tool shed.""" @@ -316,5 +316,6 @@ """Return a valid URL produced by appending a base URL and a set of request parameters.""" parts = [] for arg in args: - parts.append( arg.strip( '/' ) ) + if arg is not None: + parts.append( arg.strip( '/' ) ) return '/'.join( parts ) diff -r 44df8d9c9aa11acf796f88203551a92ac03c559d -r 472fa62aaf72a1b7c8a2520665efdc833d2ab5fc lib/tool_shed/util/shed_util_common.py --- a/lib/tool_shed/util/shed_util_common.py +++ b/lib/tool_shed/util/shed_util_common.py @@ -929,6 +929,11 @@ """ # This method is used only in Galaxy, not the Tool Shed. We store the port (if one exists) in the database. tool_shed = common_util.remove_protocol_from_tool_shed_url( tool_shed ) + if tool_shed is None or name is None or owner is None or changeset_revision is None: + message = "Unable to retrieve the repository record from the database because one or more of the following " + message += "required parameters is None: tool_shed: %s, name: %s, owner: %s, changeset_revision: %s " % \ + ( str( tool_shed ), str( name ), str( owner ), str( changeset_revision ) ) + raise Exception( message ) repository = get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app=app, tool_shed=tool_shed, name=name, @@ -1343,6 +1348,11 @@ the received tool_shed_url / name / owner combination. """ tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( app, tool_shed_url ) + if tool_shed_url is None or name is None or owner is None or changeset_revision is None: + message = "Unable to get updated changeset revisions from the Tool Shed because one or more of the following " + message += "required parameters is None: tool_shed_url: %s, name: %s, owner: %s, changeset_revision: %s " % \ + ( str( tool_shed_url ), str( name ), str( owner ), str( changeset_revision ) ) + raise Exception( message ) params = '?name=%s&owner=%s&changeset_revision=%s' % ( name, owner, changeset_revision ) url = common_util.url_join( tool_shed_url, 'repository/updated_changeset_revisions%s' % params ) 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.