commit/galaxy-central: greg: Improve logging when creating or updating tool dependency records installed into Galaxy.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/9264df2bd5f0/ Changeset: 9264df2bd5f0 User: greg Date: 2013-12-22 14:13:19 Summary: Improve logging when creating or updating tool dependency records installed into Galaxy. Affected #: 2 files diff -r 37ddaa4b6a112c776b5ac011464b680c9cb50545 -r 9264df2bd5f015e7d8c011683b4f89e6beeacb4a lib/tool_shed/galaxy_install/tool_dependencies/install_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py @@ -88,23 +88,29 @@ # the path defined by required_tool_dependency_env_file_path. It doesn't matter if the required env.sh # file currently exists.. required_tool_dependency_env_file_path = \ - tool_dependency_util.get_required_repository_package_env_sh_path( app, package_name, package_version, required_repository ) + tool_dependency_util.get_required_repository_package_env_sh_path( app, + package_name, + package_version, + required_repository ) env_file_builder = fabric_util.EnvFileBuilder( tool_dependency.installation_directory( app ) ) env_file_builder.append_line( action="source", value=required_tool_dependency_env_file_path ) return_code = env_file_builder.return_code if return_code: - error_message = 'Error defining env.sh file for package %s, return_code: %s' % ( str( package_name ), str( return_code ) ) - tool_dependency = tool_dependency_util.handle_tool_dependency_installation_error( app, - tool_dependency, - error_message, - remove_installation_path=False ) + error_message = 'Error defining env.sh file for package %s, return_code: %s' % \ + ( str( package_name ), str( return_code ) ) + tool_dependency = \ + tool_dependency_util.handle_tool_dependency_installation_error( app, + tool_dependency, + error_message, + remove_installation_path=False ) elif required_tool_dependency is not None and required_tool_dependency.in_error_state: error_message = "This tool dependency's required tool dependency %s version %s has status %s." % \ ( str( required_tool_dependency.name ), str( required_tool_dependency.version ), str( required_tool_dependency.status ) ) - tool_dependency = tool_dependency_util.handle_tool_dependency_installation_error( app, - tool_dependency, - error_message, - remove_installation_path=False ) + tool_dependency = \ + tool_dependency_util.handle_tool_dependency_installation_error( app, + tool_dependency, + error_message, + remove_installation_path=False ) else: tool_dependency = \ tool_dependency_util.set_tool_dependency_attributes( app, diff -r 37ddaa4b6a112c776b5ac011464b680c9cb50545 -r 9264df2bd5f015e7d8c011683b4f89e6beeacb4a lib/tool_shed/util/tool_dependency_util.py --- a/lib/tool_shed/util/tool_dependency_util.py +++ b/lib/tool_shed/util/tool_dependency_util.py @@ -51,18 +51,25 @@ else: tool_dependency = get_tool_dependency_by_name_type_repository( app, tool_shed_repository, name, type ) if tool_dependency: - log.debug( 'Updating an existing record for tool dependency %s version %s for tool shed repository %s with changeset revision %s.' % - ( str( name ), str( version ), str( tool_shed_repository.name ), str( tool_shed_repository.changeset_revision ) ) ) # In some cases we should not override the current status of an existing tool_dependency, so do so only if set_status is True. if set_status: + if str( tool_dependency.status ) != str( status ): + debug_msg = 'Updating an existing record for version %s of tool dependency %s for revision %s of repository %s ' % \ + ( str( version ), str( name ), str( tool_shed_repository.changeset_revision ), str( tool_shed_repository.name ) ) + debug_msg += 'by updating the status from %s to %s.' % str( tool_dependency.status ), str( status ) + log.debug( debug_msg ) tool_dependency.status = status + context.add( tool_dependency ) + context.flush() else: # Create a new tool_dependency record for the tool_shed_repository. - log.debug( 'Creating a new record for tool dependency %s version %s for tool shed repository %s with changeset revision %s.' % - ( str( name ), str( version ), str( tool_shed_repository.name ), str( tool_shed_repository.changeset_revision ) ) ) + debug_msg = 'Creating a new record for version %s of tool dependency %s for revision %s of repository %s. ' % \ + ( str( version ), str( name ), str( tool_shed_repository.changeset_revision ), str( tool_shed_repository.name ) ) + debug_msg += 'The statis is being set to %s.' % str( status ) + log.debug( debug_msg ) tool_dependency = app.install_model.ToolDependency( tool_shed_repository.id, name, version, type, status ) - context.add( tool_dependency ) - context.flush() + context.add( tool_dependency ) + context.flush() return tool_dependency def create_tool_dependency_objects( app, tool_shed_repository, relative_install_dir, set_status=True ): 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