Skip to content

PyYAML requires Loader to be specified #7628

@hagbarddenstore

Description

@hagbarddenstore

NetBox version

v3.0.8

Python version

3.9

Steps to Reproduce

  1. Run any script that calls load_yaml

Expected Behavior

The script should run without raising exceptions.

Observed Behavior

The script raises the following exception:

Traceback (most recent call last):
  File "/opt/netbox/netbox-0266ed5ce49534a388966caff5a7c0a2a47f23bd/netbox/extras/scripts.py", line 425, in _run_script
    script.output = script.run(data=data, commit=commit)
  File "/opt/netbox/netbox-0266ed5ce49534a388966caff5a7c0a2a47f23bd/netbox/scripts/my_script.py", line 145, in run
    config = self.load_yaml('my_script.yml')
  File "/opt/netbox/netbox-0266ed5ce49534a388966caff5a7c0a2a47f23bd/netbox/extras/scripts.py", line 350, in load_yaml
    data = yaml.load(datafile)
TypeError: load() missing 1 required positional argument: 'Loader'

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions