Merge pull request #1819 from dannon/whitelist_reloading_logging

Whitelist logging tweaks
This commit is contained in:
Nicola Soranzo
2016-03-01 11:52:14 +00:00
2 changed files with 4 additions and 3 deletions
+1
View File
@@ -50,6 +50,7 @@ class UniverseApplication( object, config.ConfiguresGalaxyMixin ):
config.configure_logging( self.config )
self.configure_fluent_log()
self.config.reload_sanitize_whitelist(explicit='sanitize_whitelist_file' in kwargs)
self.amqp_internal_connection_obj = galaxy.queues.connection_from_config(self.config)
# control_worker *can* be initialized with a queue, but here we don't
# want to and we'll allow postfork to bind and start it.
+3 -3
View File
@@ -267,7 +267,6 @@ class Configuration( object ):
self.log_events = string_as_bool( kwargs.get( 'log_events', 'False' ) )
self.sanitize_all_html = string_as_bool( kwargs.get( 'sanitize_all_html', True ) )
self.sanitize_whitelist_file = resolve_path( kwargs.get( 'sanitize_whitelist_file', "config/sanitize_whitelist.txt" ), self.root )
self.reload_sanitize_whitelist()
self.serve_xss_vulnerable_mimetypes = string_as_bool( kwargs.get( 'serve_xss_vulnerable_mimetypes', False ) )
self.allowed_origin_hostnames = self._parse_allowed_origin_hostnames( kwargs )
self.trust_ipython_notebook_conversion = string_as_bool( kwargs.get( 'trust_ipython_notebook_conversion', False ) )
@@ -484,7 +483,7 @@ class Configuration( object ):
else:
return None
def reload_sanitize_whitelist( self ):
def reload_sanitize_whitelist( self, explicit=True ):
self.sanitize_whitelist = []
try:
with open(self.sanitize_whitelist_file, 'rt') as f:
@@ -492,7 +491,8 @@ class Configuration( object ):
if not line.startswith("#"):
self.sanitize_whitelist.append(line.strip())
except IOError:
log.warning("Sanitize log file %s does not exist, continuing with no tools whitelisted.", self.sanitize_whitelist_file)
if explicit:
log.warning("Sanitize log file explicitly specified as '%s' but does not exist, continuing with no tools whitelisted.", self.sanitize_whitelist_file)
def __parse_config_file_options( self, kwargs ):
"""