From c86e4940afc4f88bfd7fc8e5f179bff98d7d9445 Mon Sep 17 00:00:00 2001 From: arcsector Date: Wed, 6 May 2020 16:58:21 -0700 Subject: [PATCH] Including pyaml's Loader to suppress warnings See these docs for info: https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation --- scripts/run-taxii-poll.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/run-taxii-poll.py b/scripts/run-taxii-poll.py index f7e9a21..5be085c 100644 --- a/scripts/run-taxii-poll.py +++ b/scripts/run-taxii-poll.py @@ -2,6 +2,7 @@ from cabby import create_client from pyaml import yaml +from yaml import Loader import pytz import argparse import os @@ -51,14 +52,14 @@ config_file = "{}/remote-servers.yml".format( log.debug("Opening config file %s", config_file) with open(config_file, "r") as f: - config = yaml.load(f.read()) + config = yaml.load(f.read(), Loader=Loader) log.debug("Config read %s", config) # Read in the local server configuration local_config = "{}/local-server.yml".format(os.path.expanduser(args.configdir)) log.debug("Reading local server config") with open(local_config, "r") as f: - local_config = yaml.load(f.read()) + local_config = yaml.load(f.read(), Loader=Loader) # Attempt to make contact with the local server log.info("Connecting to local server...")