diff --git a/elastic_recheck/cmd/query.py b/elastic_recheck/cmd/query.py index f212ef4f..b7a86f7b 100755 --- a/elastic_recheck/cmd/query.py +++ b/elastic_recheck/cmd/query.py @@ -69,7 +69,7 @@ def query(query_file_name, config=None, days=DEFAULT_NUMBER_OF_DAYS, indexfmt=_config.es_index_format) with open(query_file_name) as f: - query_file = yaml.load(f.read()) + query_file = yaml.load(f.read(), Loader=yaml.SafeLoader) query = query_file['query'] r = es.search(query, days=days) diff --git a/elastic_recheck/tests/unit/test_bot.py b/elastic_recheck/tests/unit/test_bot.py index 1e97383e..5899bed9 100644 --- a/elastic_recheck/tests/unit/test_bot.py +++ b/elastic_recheck/tests/unit/test_bot.py @@ -55,7 +55,7 @@ class TestBot(unittest.TestCase): _set_fake_config(self.fake_config) config = er_conf.Config(config_obj=self.fake_config) self.channel_config = bot.ChannelConfig(yaml.load( - open('recheckwatchbot.yaml'))) + open('recheckwatchbot.yaml'), Loader=yaml.SafeLoader)) with mock.patch('launchpadlib.launchpad.Launchpad'): self.recheck_watch = bot.RecheckWatch( None, @@ -101,7 +101,7 @@ class TestBotWithTestTools(tests.TestCase): _set_fake_config(self.fake_config) config = er_conf.Config(config_obj=self.fake_config) self.channel_config = bot.ChannelConfig(yaml.load( - open('recheckwatchbot.yaml'))) + open('recheckwatchbot.yaml'), Loader=yaml.SafeLoader)) with mock.patch('launchpadlib.launchpad.Launchpad'): self.recheck_watch = bot.RecheckWatch( None,