X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fwrk%2Fwrk_traffic_profile_parser.py;h=f5534657055a1b49afee05aec5bd8db270b2c1bf;hb=39c81e3674295df82172ac8df1fe3c1184b1d896;hp=1994b6195d791ee44535a899e054b524cc793890;hpb=d68951ac245150eeefa6e0f4156e4c1b5c9e9325;p=csit.git diff --git a/resources/tools/wrk/wrk_traffic_profile_parser.py b/resources/tools/wrk/wrk_traffic_profile_parser.py index 1994b6195d..f553465705 100644 --- a/resources/tools/wrk/wrk_traffic_profile_parser.py +++ b/resources/tools/wrk/wrk_traffic_profile_parser.py @@ -20,7 +20,7 @@ See LLD for the structure of a wrk traffic profile. from os.path import isfile from pprint import pformat -from yaml import load, YAMLError +from yaml import safe_load, YAMLError from robot.api import logger from resources.tools.wrk.wrk_errors import WrkError @@ -61,8 +61,8 @@ class WrkTrafficProfile: self.profile_name = profile_name try: - with open(self.profile_name, "r") as profile_file: - self.traffic_profile = load(profile_file) + with open(self.profile_name, u"rt") as profile_file: + self.traffic_profile = safe_load(profile_file) except IOError as err: raise WrkError( msg=f"An error occurred while opening the file "