Variable 'ds_name' referenced before assignment
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Lunar |
Fix Released
|
Undecided
|
Unassigned | ||
Mantic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
=== Begin SRU Template ===
[Impact]
In 23.2, a function was added to match a case-insensitive module name with its corresponding module. This includes setting a variable in a conditional and then referencing it later such that if the 'if condition' is missed, cloud-init will traceback with a variable reference before assignment exception.
The issue is triggered by a datasource specified in the datasource_list having a "DataSource" prefix. For example, on LXD:
datasource_list: [ "LXD" ]
and
datasource_list: [ "DataSourceLXD" ]
are both valid ways to specify the LXD data source. By default, datasources do not use the "DataSource" prefix in cloud-init, so unaltered Ubuntu images should not be affected. Any instance adding custom config to specify a datasource with the "DataSource" prefix is affected.
[Test Case]
* Create /etc/cloud/
* Verify cloud-init runs without traceback in /var/log/
* Verify cloud-init correctly uses the LXD datasource
[Regression Potential]
If there is any other way we could mismatch a name, it's possible we would return an invalid datasource name that cannot be initialized.
[Other Info]
Upstream bug: https:/
Upstream fix: https:/
description: | updated |
description: | updated |
description: | updated |
description: | updated |
tags: |
added: verification-done verification-done-focal verification-done-jammy verification-done-lunar removed: verification-needed verification-needed-focal verification-needed-jammy verification-needed-lunar |
This bug was fixed in the package cloud-init - 23.3~4ga31370af -0ubuntu1
--------------- f-0ubuntu1) mantic; urgency=medium
cloud-init (23.3~4ga31370a
* Upstream snapshot based on upstream/main at a31370af. init.maintscrip t: Remove the unused hook-network- manager
- Bugs fixed in this snapshot: (LP: #1923363, #2028562, #2028784)
* d/cloud-
conffile. (LP: #2027861)
* d/control: Add python3-passlib as needed for testing
-- James Falcon <email address hidden> Mon, 31 Jul 2023 11:38:42 -0500