Support newer version of yaml

yaml.load will report a warning in pyyaml 5 and an error
in pyyaml 6 if it is called without a Loader argument.

The no-member pylint error was being suppressed due to
legacy http code, so now that is un-suppressed globally
and the yaml.load is replaced with yaml.safe_load

Test Plan:
  PASS: tox
  PASS: yaml.load('events.yaml') returns the same content
       as yaml.safe_load('events.yaml')

Story: 2010642
Task: 48157
Signed-off-by: Al Bailey <>
Change-Id: Ibac118cd9555f3334251b10a6b3e0a5986285854
Al Bailey 2023-05-31 16:36:27 +00:00
parent 6172b8ee41
commit a425fa6626
3 changed files with 3 additions and 4 deletions

View File

@ -107,7 +107,7 @@ if not os.path.isfile(EVENT_TYPES_FILE):
with open(EVENT_TYPES_FILE, 'r') as stream:
event_types = yaml.load(stream)
event_types = yaml.safe_load(stream)
except Exception as exp:
raise RuntimeError(exp)

View File

@ -71,7 +71,6 @@ extension-pkg-whitelist=lxml.etree,greenlet
# E0604 invalid-all-object
# E1101 no-member
# E1102 not-callable
# E1120 no-value-for-parameter
# E1121 too-many-function-args
# E1123 unexpected-keyword-arg
# NOTE: these are suppressed until py3 support merges:
@ -80,7 +79,7 @@ disable=C, R, fixme,
# Set the output format. Available formats are text, parseable, colorized, msvs

View File

@ -104,7 +104,7 @@ class _BaseHTTPClient(object):
resp.request.path_url != '/versions'):
# NOTE(flaper87): Eventually, we'll remove the check on `versions`
# which is a bug (1491350) on the server.
raise exc.from_response(resp)
raise exc.from_response(resp) # pylint: disable=no-value-for-parameter
content_type = resp.headers.get('Content-Type')