mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-28 02:58:18 +08:00
Remove deprecated repair repository feature
This commit is contained in:
@@ -15,7 +15,6 @@ from tool_shed.galaxy_install import install_manager
|
||||
from tool_shed.galaxy_install.grids import admin_toolshed_grids
|
||||
from tool_shed.galaxy_install.installed_repository_manager import InstalledRepositoryManager
|
||||
from tool_shed.galaxy_install.metadata.installed_repository_metadata_manager import InstalledRepositoryMetadataManager
|
||||
from tool_shed.galaxy_install.repair_repository_manager import RepairRepositoryManager
|
||||
from tool_shed.galaxy_install.repository_dependencies import repository_dependency_manager
|
||||
from tool_shed.galaxy_install.tools import data_manager
|
||||
from tool_shed.galaxy_install.tools import tool_panel_manager
|
||||
@@ -1318,63 +1317,6 @@ class AdminToolshed(AdminGalaxy):
|
||||
initiate_repository_installation_ids=encoded_repository_ids,
|
||||
reinstalling=True)
|
||||
|
||||
@web.expose
|
||||
@web.require_admin
|
||||
def repair_repository(self, trans, **kwd):
|
||||
"""
|
||||
Inspect the repository dependency hierarchy for a specified repository and attempt to make sure they are all properly installed as well as
|
||||
each repository's tool dependencies.
|
||||
"""
|
||||
message = escape(kwd.get('message', ''))
|
||||
status = kwd.get('status', 'done')
|
||||
repository_id = kwd.get('id', None)
|
||||
if not repository_id:
|
||||
message = 'Invalid installed tool shed repository id %s received.' % str(repository_id)
|
||||
return trans.show_error_message(message)
|
||||
tool_shed_repository = repository_util.get_installed_tool_shed_repository(trans.app, repository_id)
|
||||
rrm = RepairRepositoryManager(trans.app)
|
||||
if kwd.get('repair_repository_button', False):
|
||||
encoded_repair_dict = kwd.get('repair_dict', None)
|
||||
if encoded_repair_dict:
|
||||
repair_dict = encoding_util.tool_shed_decode(encoded_repair_dict)
|
||||
else:
|
||||
repair_dict = None
|
||||
if not repair_dict:
|
||||
repair_dict = rrm.get_repair_dict(tool_shed_repository)
|
||||
ordered_tsr_ids = repair_dict.get('ordered_tsr_ids', [])
|
||||
ordered_repo_info_dicts = repair_dict.get('ordered_repo_info_dicts', [])
|
||||
if ordered_tsr_ids and ordered_repo_info_dicts:
|
||||
repositories_for_repair = []
|
||||
for tsr_id in ordered_tsr_ids:
|
||||
repository = trans.install_model.context.query(trans.install_model.ToolShedRepository).get(trans.security.decode_id(tsr_id))
|
||||
repositories_for_repair.append(repository)
|
||||
return self.repair_tool_shed_repositories(trans, rrm, repositories_for_repair, ordered_repo_info_dicts)
|
||||
tool_shed_repository = repository_util.get_installed_tool_shed_repository(trans.app, repository_id)
|
||||
repair_dict = rrm.get_repair_dict(tool_shed_repository)
|
||||
encoded_repair_dict = encoding_util.tool_shed_encode(repair_dict)
|
||||
ordered_tsr_ids = repair_dict.get('ordered_tsr_ids', [])
|
||||
ordered_repo_info_dicts = repair_dict.get('ordered_repo_info_dicts', [])
|
||||
return trans.fill_template('admin/tool_shed_repository/repair_repository.mako',
|
||||
repository=tool_shed_repository,
|
||||
encoded_repair_dict=encoded_repair_dict,
|
||||
repair_dict=repair_dict,
|
||||
message=message,
|
||||
status=status)
|
||||
|
||||
@web.expose
|
||||
@web.require_admin
|
||||
def repair_tool_shed_repositories(self, trans, repair_repository_manager, tool_shed_repositories, repo_info_dicts, **kwd):
|
||||
"""Repair specified tool shed repositories."""
|
||||
# The received lists of tool_shed_repositories and repo_info_dicts are ordered.
|
||||
for index, tool_shed_repository in enumerate(tool_shed_repositories):
|
||||
repo_info_dict = repo_info_dicts[index]
|
||||
repair_repository_manager.repair_tool_shed_repository(tool_shed_repository,
|
||||
encoding_util.tool_shed_encode(repo_info_dict))
|
||||
tsr_ids_for_monitoring = [trans.security.encode_id(tsr.id) for tsr in tool_shed_repositories]
|
||||
return trans.response.send_redirect(web.url_for(controller='admin_toolshed',
|
||||
action='monitor_repository_installation',
|
||||
tool_shed_repository_ids=tsr_ids_for_monitoring))
|
||||
|
||||
@web.json
|
||||
def repository_installation_status_updates(self, trans, ids=None, status_list=None):
|
||||
# Avoid caching
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
<%inherit file="/base.mako"/>
|
||||
<%namespace file="/message.mako" import="render_msg" />
|
||||
<%namespace file="/admin/tool_shed_repository/repository_actions_menu.mako" import="*" />
|
||||
|
||||
<%def name="stylesheets()">
|
||||
${parent.stylesheets()}
|
||||
${h.css( "library" )}
|
||||
</%def>
|
||||
|
||||
<%def name="javascripts()">
|
||||
${parent.javascripts()}
|
||||
</%def>
|
||||
|
||||
${render_galaxy_repository_actions( repository )}
|
||||
|
||||
%if message:
|
||||
${render_msg( message, status )}
|
||||
%endif
|
||||
|
||||
<div class="warningmessage">
|
||||
<p>
|
||||
The following repositories will be inspected and repaired in the order listed to ensure each repository and all of its tool dependencies are
|
||||
correctly installed.
|
||||
</p>
|
||||
<p>
|
||||
Existing system processes associated with repositories or tool dependencies that are currently being installed will not be automatically
|
||||
terminated. If possible, make sure no installation processes are still running for repositories whose status is or includes <b>cloning</b>,
|
||||
<b>setting tool versions</b>, <b>installing repository dependencies</b>, or <b>installing tool dependencies</b> before clicking the <b>Repair</b>
|
||||
button.
|
||||
</p>
|
||||
<p>
|
||||
All repositories that do not display an <b>Installed</b> status will be removed from disk and reinstalled.
|
||||
</p>
|
||||
<p>
|
||||
Click <b>Repair</b> to inspect and repair these repositories.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="toolForm">
|
||||
<div class="toolFormTitle">Repair tool shed repository <b>${repository.name|h}</b></div>
|
||||
<form name="repair_repository" id="repair_repository" action="${h.url_for( controller='admin_toolshed', action='repair_repository', id=trans.security.encode_id( repository.id ) )}" method="post" >
|
||||
<input type="hidden" name="repair_dict" value="${encoded_repair_dict|h}"/>
|
||||
<%
|
||||
from tool_shed.util.repository_util import get_tool_shed_repository_status_label
|
||||
ordered_repo_info_dicts = repair_dict.get( 'ordered_repo_info_dicts', [] )
|
||||
%>
|
||||
<table class="grid">
|
||||
<tr>
|
||||
<th bgcolor="#D8D8D8">Name</th>
|
||||
<th bgcolor="#D8D8D8">Owner</th>
|
||||
<th bgcolor="#D8D8D8">Changeset revision</th>
|
||||
<th bgcolor="#D8D8D8">Status</th>
|
||||
</tr>
|
||||
%for repo_info_dict in ordered_repo_info_dicts:
|
||||
<%
|
||||
for name, repo_info_tuple in repo_info_dict.items():
|
||||
description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, tool_dependencies = repo_info_tuple
|
||||
break
|
||||
status_label = get_tool_shed_repository_status_label( trans.app,
|
||||
tool_shed_repository=None,
|
||||
name=name,
|
||||
owner=repository_owner,
|
||||
changeset_revision=changeset_revision,
|
||||
repository_clone_url=repository_clone_url )
|
||||
%>
|
||||
<tr>
|
||||
<td>${name | h}</td>
|
||||
<td>${repository_owner | h}</td>
|
||||
<td>${changeset_revision | h}</td>
|
||||
<td>${status_label}</td>
|
||||
</tr>
|
||||
%endfor
|
||||
</table>
|
||||
<div style="clear: both"></div>
|
||||
<div class="form-row">
|
||||
<input type="submit" name="repair_repository_button" value="Repair"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,7 +41,6 @@
|
||||
%endif
|
||||
<a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a>
|
||||
%endif
|
||||
<a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='repair_repository', id=trans.security.encode_id( repository.id ) )}">Repair repository</a>
|
||||
</div>
|
||||
</ul>
|
||||
</%def>
|
||||
|
||||
Reference in New Issue
Block a user