From 58af25836cfe9aa3b5b15cb3e5aafe54b8ed10fb Mon Sep 17 00:00:00 2001 From: M Bernt Date: Mon, 4 Nov 2019 10:29:44 +0100 Subject: [PATCH 1/2] specify yaml loader Since PyYAML 5.1 loading a yaml file without specifying a loader raises a deprecation note: ``` YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. conf = yaml.load(open(args.config,'r')) ``` see also https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation so I suggest to specify the FullLoader (we could also go for another one). --- pull_galaxy_config.py | 2 +- unused_history_cleanup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pull_galaxy_config.py b/pull_galaxy_config.py index 4160999..5444339 100644 --- a/pull_galaxy_config.py +++ b/pull_galaxy_config.py @@ -60,7 +60,7 @@ def main(): parser.print_help() exit(1) - conf = yaml.load(open(args.config,'r')) + conf = yaml.load(open(args.config,'r'), Loader=yaml.FullLoader) key = conf['key_file'] user = conf['username'] diff --git a/unused_history_cleanup.py b/unused_history_cleanup.py index 0dd1264..c7ac4da 100644 --- a/unused_history_cleanup.py +++ b/unused_history_cleanup.py @@ -196,7 +196,7 @@ def main(): parser.print_help() exit(1) - conf = yaml.load(open(args.config,'r')) + conf = yaml.load(open(args.config,'r'), Loader=yaml.FullLoader) #Connection stuff pg_host = conf['pg_host'] From 1c3dc0e3003aae0d26bf46e82f2c0e889d412ea0 Mon Sep 17 00:00:00 2001 From: M Bernt Date: Mon, 11 Nov 2019 09:31:20 +0100 Subject: [PATCH 2/2] add forgotten parameter to send_email... --- unused_history_cleanup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unused_history_cleanup.py b/unused_history_cleanup.py index c7ac4da..6fb846d 100644 --- a/unused_history_cleanup.py +++ b/unused_history_cleanup.py @@ -317,7 +317,7 @@ def main(): conn.close() for u in user_warns.keys(): - send_email_to_user(user_warns[u], user_warn_hists[u], warn_threshold, delete_threshold, server_name, smtp_server, from_addr, response_addr, info_url, VERBOSE) + send_email_to_user(user_warns[u], user_warn_hists[u], warn_threshold, delete_threshold, server_name, smtp_server, from_addr, response_addr, bcc_addr, info_url, VERBOSE) return