Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_should_wait_via_user_data assumes #cloud-config-archive is #cloud-config, causing python error #5975

Closed
kageurufu opened this issue Jan 14, 2025 · 1 comment
Labels
bug Something isn't working correctly

Comments

@kageurufu
Copy link

Bug report

When submitting #cloud-config-archive as user data, _should_wait_via_user_data cuts off too much of the file header and only sees #cloud-config due to using the slice [:13].

Steps to reproduce the problem

Submit a cloud-config-archive userdata.

Environment details

  • Cloud-init version: 24.4
  • Operating System Distribution: Ubuntu 24.04
  • Cloud provider, platform or installer type: OpenStack

cloud-init logs

2025-01-14 20:46:59,232 - main.py[ERROR]: failed stage init-local
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 922, in status_wrapper
    ret = functor(name, args)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 556, in main_init
    should_wait, reason = _should_wait_on_network(init.datasource)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 379, in _should_wait_on_network
    user_should_wait, user_reason = _should_wait_via_user_data(
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 359, in _should_wait_via_user_data
    if parsed_yaml.get("bootcmd"):
       ^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'get'
@kageurufu kageurufu added bug Something isn't working correctly new An issue that still needs triage labels Jan 14, 2025
TheRealFalcon added a commit to TheRealFalcon/cloud-init that referenced this issue Jan 14, 2025
The function "_should_wait_via_user_data()" needs to be able to handle
non-dict data (i.e., #cloud-config-archive).

Fixes canonicalGH-5975
@TheRealFalcon
Copy link
Member

Thanks for the bug report. This is being addressed in #5976

@TheRealFalcon TheRealFalcon removed the new An issue that still needs triage label Jan 14, 2025
TheRealFalcon added a commit to TheRealFalcon/cloud-init that referenced this issue Jan 15, 2025
…anonical#5976)

The function "_should_wait_via_user_data()" wasn't properly
handling user data that has a header that starts with
#cloud-config, but isn't cloud-config, like #cloud-config-archive

Fixes canonicalGH-5975
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

2 participants