-
Notifications
You must be signed in to change notification settings - Fork 992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the configured tool_path when loading data managers #3989
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,23 +7,37 @@ | |
from tool_shed.util import xml_util | ||
|
||
log = logging.getLogger( __name__ ) | ||
# <data_managers tool_path="/var/galaxy/data_managers"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is probably a dev remnant? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is exactly what it is. I even reminded myself to remove it before pushing. |
||
|
||
|
||
class DataManagerHandler( object ): | ||
|
||
def __init__( self, app ): | ||
self.app = app | ||
|
||
@property | ||
def data_managers_path( self ): | ||
tree, error_message = xml_util.parse_xml( self.app.config.shed_data_manager_config_file ) | ||
if tree: | ||
root = tree.getroot() | ||
data_managers_path = root.get( 'tool_path', None ) | ||
return data_managers_path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remove one blank line to make flake8 happy? |
||
def data_manager_config_elems_to_xml_file( self, config_elems, config_filename ): | ||
""" | ||
Persist the current in-memory list of config_elems to a file named by the value | ||
of config_filename. | ||
""" | ||
data_managers_path = self.data_managers_path | ||
lock = threading.Lock() | ||
lock.acquire( True ) | ||
try: | ||
fh = open( config_filename, 'wb' ) | ||
fh.write( '<?xml version="1.0"?>\n<data_managers>\n' ) | ||
if data_managers_path is not None: | ||
fh.write( '<?xml version="1.0"?>\n<data_managers tool_path="%s">\n ' % data_managers_path ) | ||
else: | ||
fh.write( '<?xml version="1.0"?>\n<data_managers>\n ' ) | ||
for elem in config_elems: | ||
fh.write( xml_util.xml_to_string( elem ) ) | ||
fh.write( '</data_managers>\n' ) | ||
|
@@ -158,4 +172,4 @@ def remove_from_data_manager( self, repository ): | |
self.app.data_managers.load_manager_from_elem( elem ) | ||
# Persist the altered shed_data_manager_config file. | ||
if data_manager_config_has_changes: | ||
self.data_manager_config_elems_to_xml_file( config_elems, shed_data_manager_conf_filename ) | ||
self.data_manager_config_elems_to_xml_file( config_elems, shed_data_manager_conf_filename ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
tool_path=self.tool_path
becausetool_path
is undefined ifstore_tool_path
is False.