Public bug reported:

Affects cloud-init version: 
24.4~3+really24.3.1-0ubuntu1 and
24.4~3+really24.3.1-0ubuntu2


A new feature added in Oracular was to allow NoCloudNet configuration to be 
detected by providing system configuration in /etc/cloud/cloud.cfg.d/*.cfg like 
the following:

datasource:
  NoCloud:
    seedfrom: http://someurl


When NoCloudNet.ds_detect attempts to process that seedfrom url from the 
respective YAML. It results in the traceback:

root@bug-o:~# grep Traceback -A 16 /var/log/cloud-init.log 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cloudinit/sources/__init__.py", line 
1055, in find_source
    if s.update_metadata_if_supported(
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/cloudinit/sources/__init__.py", line 
931, in update_metadata_if_supported
    result = self.get_data()
             ^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/cloudinit/sources/__init__.py", line 
487, in get_data
    return_value = self._check_and_get_data()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/cloudinit/sources/__init__.py", line 
413, in _check_and_get_data
    elif self.ds_detect():
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceNoCloud.py", 
line 458, in ds_detect
    .key("seedfrom")
     ^^^
AttributeError: 'dict' object has no attribute 'key'. Did you mean: 'keys'?


### steps to reproduce
cat > lp-321.cfg <<EOF
datasource_list: [ NoCloud, None]
datasource:
  NoCloud:
    seedfrom: https://192.168.1.8/nocloud/
EOF
lxc init ubuntu-daily:oracular lp-321 -c security.nesting=true
lxc file push lp-321.cfg lp-321/etc/cloud/cloud.cfg.d/
lxc start lp-321
lxc exec lp-321 -- cloud-init status --long
lxc exec lp-321 -- grep Traceback -A 16 /var/log/cloud-init.log

** Affects: cloud-init (Ubuntu)
     Importance: High
         Status: Fix Committed

** Changed in: cloud-init (Ubuntu)
   Importance: Undecided => High

** Changed in: cloud-init (Ubuntu)
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2080688

Title:
  oracular: NoCloudNet datasource `seedfrom` URL in
  /etc/cloud/cloud.cfg.d results in traceback

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2080688/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to