yaml.load error on configure

Bug #1960676 reported by Rodrigo Barbieri
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
stsstack-bundles
Fix Released
Undecided
Rodrigo Barbieri

Bug Description

when running ./configure:

+ ./bin/post-deploy-config neutron-gateway
Using default network name: ganso_admin_net
Traceback (most recent call last):
  File "./bin/post-deploy-config", line 95, in <module>
    service_config = yaml.load(
TypeError: load() missing 1 required positional argument: 'Loader'

I found this strange, but then I googled and found this [1]. Maybe I updated something python-related in my bastion and I didn't notice.

https://stackoverflow.com/questions/69564817/typeerror-load-missing-1-required-positional-argument-loader-in-google-col

Related branches

Changed in stsstack-bundles:
assignee: nobody → Rodrigo Barbieri (rodrigo-barbieri2010)
status: New → In Progress
Revision history for this message
Edward Hope-Morley (hopem) wrote :

@rodrigo-barbieri2010 what version of python3-yaml do you have?

Revision history for this message
Rodrigo Barbieri (rodrigo-barbieri2010) wrote :

5.3.1-1ubuntu0.1

Revision history for this message
Edward Hope-Morley (hopem) wrote :

hmm yeah I have that same version. I wonder why yours is failing like that (it's not an issue that anyone else has reported).

I'm curious. Can you run the script with debug output e.g.

bash -x ./bin/post-deploy-config neutron-gateway

And provide the output?

Revision history for this message
Rodrigo Barbieri (rodrigo-barbieri2010) wrote :

post-deploy-config is python, not bash. See:

https://pastebin.canonical.com/p/b3xvF63WGy/

I changed the code around line 95 to be:

    data = subprocess.check_output(['juju', 'status', '--format=yaml',
                                 service]).decode('UTF-8')
    print(data)
    service_config = yaml.load(data)

and the output was: https://pastebin.canonical.com/p/HHwMJqYNh8/

Also:

>>> yaml.load.__code__
<code object load at 0x7f54d0555a80, file "/home/ubuntu/.local/lib/python3.8/site-packages/yaml/__init__.py", line 74>

on that file, line 74:

def load(stream, Loader):

So I guess I accidentally installed the pip version and am using pip instead of python3-yaml. But in other words it also means it will eventually break in the future :)

$ pip3 list | grep PyYAML
PyYAML 6.0

Changed in stsstack-bundles:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.