Resolve unsafe yaml.load use
Fxed deprecation warning about unsafe call Change-Id: I474454f438d6345dea76daf788be14c93fee6fb6
This commit is contained in:
parent
673a054b17
commit
8f709c1d67
@ -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)
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user