From 4e75635d629f654f7b9d203fa6b6c1bc61495aa6 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Tue, 15 Aug 2017 11:49:49 +0100 Subject: [PATCH] Use log.warning() instead of deprecated warn() --- lib/galaxy/config.py | 2 +- lib/galaxy/jobs/runners/kubernetes.py | 4 ++-- lib/galaxy/tools/execute.py | 2 +- lib/galaxy/web/framework/webapp.py | 4 ++-- lib/galaxy/webapps/galaxy/api/users.py | 2 +- scripts/communication/communication_server.py | 2 +- scripts/secret_decoder_ring.py | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/galaxy/config.py b/lib/galaxy/config.py index b810d89cf8a..44c4bfcd8f8 100644 --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -246,7 +246,7 @@ class Configuration(object): self.cleanup_job = kwargs.get("cleanup_job", "always") preserve_python_environment = kwargs.get("preserve_python_environment", "legacy_only") if preserve_python_environment not in ["legacy_only", "legacy_and_local", "always"]: - log.warn("preserve_python_environment set to unknown value [%s], defaulting to legacy_only") + log.warning("preserve_python_environment set to unknown value [%s], defaulting to legacy_only") preserve_python_environment = "legacy_only" self.preserve_python_environment = preserve_python_environment # Older default container cache path, I don't think anyone is using it anymore and it wasn't documented - we diff --git a/lib/galaxy/jobs/runners/kubernetes.py b/lib/galaxy/jobs/runners/kubernetes.py index beb16c9bfc6..b6027437044 100644 --- a/lib/galaxy/jobs/runners/kubernetes.py +++ b/lib/galaxy/jobs/runners/kubernetes.py @@ -132,7 +132,7 @@ class KubernetesJobRunner(AsynchronousJobRunner): try: return int(self.runner_params["k8s_supplemental_group_id"]) except: - log.warn("Supplemental group passed for Kubernetes runner needs to be an integer, value " + log.warning("Supplemental group passed for Kubernetes runner needs to be an integer, value " + self.runner_params["k8s_supplemental_group_id"] + " passed is invalid") return None return None @@ -142,7 +142,7 @@ class KubernetesJobRunner(AsynchronousJobRunner): try: return int(self.runner_params["k8s_fs_group_id"]) except: - log.warn("FS group passed for Kubernetes runner needs to be an integer, value " + log.warning("FS group passed for Kubernetes runner needs to be an integer, value " + self.runner_params["k8s_fs_group_id"] + " passed is invalid") return None return None diff --git a/lib/galaxy/tools/execute.py b/lib/galaxy/tools/execute.py index 6d3442737e9..c24a57af1c0 100644 --- a/lib/galaxy/tools/execute.py +++ b/lib/galaxy/tools/execute.py @@ -88,7 +88,7 @@ def execute(trans, tool, param_combinations, history, rerun_remap_job_id=None, c if len(param_combinations) == 0: template = "Attempting to map over an empty collection, this is not yet implemented. collection_info is [%s]" message = template % collection_info - log.warn(message) + log.warning(message) raise Exception(message) params = param_combinations[0] execution_tracker.create_output_collections(trans, history, params) diff --git a/lib/galaxy/web/framework/webapp.py b/lib/galaxy/web/framework/webapp.py index be91c09b9ed..9c0521efe91 100644 --- a/lib/galaxy/web/framework/webapp.py +++ b/lib/galaxy/web/framework/webapp.py @@ -894,10 +894,10 @@ class GalaxyWebTransaction(base.DefaultWebTransaction, session_csrf_token = self.request.params.get("session_csrf_token", None) problem = False if not session_csrf_token: - log.warn("No session_csrf_token set, denying request.") + log.warning("No session_csrf_token set, denying request.") problem = True elif session_csrf_token != self.session_csrf_token: - log.warn("Wrong session token found, denying request.") + log.warning("Wrong session token found, denying request.") problem = True if problem: diff --git a/lib/galaxy/webapps/galaxy/api/users.py b/lib/galaxy/webapps/galaxy/api/users.py index bd58275ee0e..48f753211fd 100644 --- a/lib/galaxy/webapps/galaxy/api/users.py +++ b/lib/galaxy/webapps/galaxy/api/users.py @@ -262,7 +262,7 @@ class UserAPIController(BaseAPIController, UsesTagsMixin, CreatesUsersMixin, Cre with open(path, 'r') as stream: config = yaml.load(stream) except: - log.warn('Config file (%s) could not be found or is malformed.' % path) + log.warning('Config file (%s) could not be found or is malformed.' % path) return {} return config['preferences'] if config else {} diff --git a/scripts/communication/communication_server.py b/scripts/communication/communication_server.py index 754f67fad0f..7e13c2f4bb2 100755 --- a/scripts/communication/communication_server.py +++ b/scripts/communication/communication_server.py @@ -56,7 +56,7 @@ app_properties = load_app_properties(ini_file=config['config_file']) # We need the ID secret for configuring the security helper to decrypt # galaxysession cookies. if "id_secret" not in app_properties: - log.warn('No ID_SECRET specified. Please set the "id_secret" in your galaxy.ini.') + log.warning('No ID_SECRET specified. Please set the "id_secret" in your galaxy.ini.') id_secret = app_properties.get('id_secret', 'dangerous_default') diff --git a/scripts/secret_decoder_ring.py b/scripts/secret_decoder_ring.py index ba021c20d0d..b7b5fc7e212 100644 --- a/scripts/secret_decoder_ring.py +++ b/scripts/secret_decoder_ring.py @@ -27,7 +27,7 @@ app_properties = load_app_properties(ini_file=config['config_file']) # We need the ID secret for configuring the security helper to decrypt # galaxysession cookies. if "id_secret" not in app_properties: - log.warn('No ID_SECRET specified. Please set the "id_secret" in your galaxy.ini.') + log.warning('No ID_SECRET specified. Please set the "id_secret" in your galaxy.ini.') id_secret = app_properties.get('id_secret', 'dangerous_default')