fix: install lxd snap only when snap list lxd reports absent#6626
Merged
Conversation
holmanb
reviewed
Dec 15, 2025
Member
holmanb
left a comment
There was a problem hiding this comment.
The proposed commit message is too long, please wrap it.
Has the integration test been failing on plucky since it was released?
Enable cloud-init to 'snap install lxd' when 'snap list lxd' reports
that the lxd snap is not available. Do not rely on which('lxd') because
lxd-installer deb package delivers this script, not the lxd snap.
Prior to Ubuntu Plucky, lxd-installer /usr/sbin/lxd would automatically
install lxd snap if it wasn't on the system. In Ubuntu Plucky and newer
lxd-installer now blocks on a user prompt "Would you like to install
LXD.. ?" which prevents cloud-init from automatically installing LXD
snap.
LP: #2136198
2ddb2e9 to
99da572
Compare
holmanb
reviewed
Dec 17, 2025
|
|
||
| if not subp.which("lxd"): | ||
| try: | ||
| subp.subp(["snap", "list", "lxd"]) |
Member
There was a problem hiding this comment.
How does backwards compatibility for this look on pre-plucky?
Collaborator
Author
There was a problem hiding this comment.
Good and same behavior from snap list:
root@jj2:~# which lxd
root@jj2:~# snap list lxd
error: no matching snaps installed
root@jj2:~# echo $?
1
---- noble
root@nn:~# which lxd
/usr/sbin/lxd
root@nn:~# snap list lxd
error: no matching snaps installed
root@nn:~# echo $?
1
MoeSalah1999
pushed a commit
to MoeSalah1999/cloud-init
that referenced
this pull request
Dec 19, 2025
…al#6626) Enable cloud-init to 'snap install lxd' when 'snap list lxd' reports that the lxd snap is not available. Do not rely on which('lxd') because lxd-installer deb package delivers this script, not the lxd snap. Prior to Ubuntu Plucky, lxd-installer /usr/sbin/lxd would automatically install lxd snap if it wasn't on the system. In Ubuntu Plucky and newer lxd-installer now blocks on a user prompt "Would you like to install LXD.. ?" which prevents cloud-init from automatically installing LXD snap. LP: #2136198
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To ease the process of reviewing your PR, do make sure to complete the following checklist before submitting a pull request.
tests/unittests/cloudinit/example.pyshould be tested bytests/unittests/test_example.pytox -e py3tox -e doc.Proposed Commit Message
Additional Context
Test Steps
Merge type