commit/galaxy-central: greg: Handle issues with invalid dicts received when from the tool shed api.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/61721f9eda65/ Changeset: 61721f9eda65 User: greg Date: 2014-01-09 03:15:31 Summary: Handle issues with invalid dicts received when from the tool shed api. Affected #: 1 file diff -r 70e221c1f38213b21c08ca44d9f92a892612d67b -r 61721f9eda65b1e7444264249815ad993e61fb27 test/install_and_test_tool_shed_repositories/base/util.py --- a/test/install_and_test_tool_shed_repositories/base/util.py +++ b/test/install_and_test_tool_shed_repositories/base/util.py @@ -469,7 +469,14 @@ def get_repository_dict( url, repository_dict ): error_message = '' - parts = [ 'api', 'repositories', repository_dict[ 'repository_id' ] ] + if not isinstance( repository_dict, dict ): + error_message = 'Invalid repository_dict received: %s' % str( repository_dict ) + return None, error_message + repository_id = repository_dict.get( 'repository_id', None ) + if repository_id is None: + error_message = 'Invalid repository_dict does not contain a repository_id entry: %s' % str( repository_dict ) + return None, error_message + parts = [ 'api', 'repositories', repository_id ] api_url = get_api_url( base=url, parts=parts ) extended_dict, error_message = json_from_url( api_url ) if error_message: 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.
participants (1)
-
commits-noreply@bitbucket.org