Merge ~johnsonshi/cloud-init:zfs-package-fix into cloud-init:master

Proposed by Johnson Shi
Status: Merged
Approved by: Chad Smith
Approved revision: ee06ac100561640ab517d72061d059c625768db9
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~johnsonshi/cloud-init:zfs-package-fix
Merge into: cloud-init:master
Diff against target: 26 lines (+2/-2)
2 files modified
cloudinit/config/cc_lxd.py (+1/-1)
tests/unittests/test_handler/test_handler_lxd.py (+1/-1)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Chad Smith Approve
Ryan Harper Pending
Scott Moser Pending
Review via email: mp+361854@code.launchpad.net

Commit message

lxd: install zfs-linux instead of zfs meta package

When using the LXD module cloud-init will attempt
to install ZFS if it does not exist on the target
system. However instead of installing the `zfsutils-linux`
package it attempts to install `zfs` resulting in an error.

Ubuntu Xenial (16.04) has zfs meta package, but Bionic (18.04)
does not. Use the specific base package instead of zfs meta.

Co-authored-by: Michael Skalka <email address hidden>

LP: #1799779

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:ee06ac100561640ab517d72061d059c625768db9
https://jenkins.ubuntu.com/server/job/cloud-init-ci/526/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/526/rebuild

review: Approve (continuous-integration)
Revision history for this message
Chad Smith (chad.smith) wrote :

Thanks for this Johnson and for adding the unit tests!
LGTM!

review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) :
review: Approve (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

Commit message lints:
 - Expected empty line on line 2 of the commit message

review: Needs Fixing
Revision history for this message
Server Team CI bot (server-team-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cloudinit/config/cc_lxd.py b/cloudinit/config/cc_lxd.py
2index 24a8ebe..71d13ed 100644
3--- a/cloudinit/config/cc_lxd.py
4+++ b/cloudinit/config/cc_lxd.py
5@@ -89,7 +89,7 @@ def handle(name, cfg, cloud, log, args):
6 packages.append('lxd')
7
8 if init_cfg.get("storage_backend") == "zfs" and not util.which('zfs'):
9- packages.append('zfs')
10+ packages.append('zfsutils-linux')
11
12 if len(packages):
13 try:
14diff --git a/tests/unittests/test_handler/test_handler_lxd.py b/tests/unittests/test_handler/test_handler_lxd.py
15index 2478ebc..b63db61 100644
16--- a/tests/unittests/test_handler/test_handler_lxd.py
17+++ b/tests/unittests/test_handler/test_handler_lxd.py
18@@ -62,7 +62,7 @@ class TestLxd(t_help.CiTestCase):
19 cc_lxd.handle('cc_lxd', self.lxd_cfg, cc, self.logger, [])
20 self.assertFalse(m_maybe_clean.called)
21 install_pkg = cc.distro.install_packages.call_args_list[0][0][0]
22- self.assertEqual(sorted(install_pkg), ['lxd', 'zfs'])
23+ self.assertEqual(sorted(install_pkg), ['lxd', 'zfsutils-linux'])
24
25 @mock.patch("cloudinit.config.cc_lxd.maybe_cleanup_default")
26 @mock.patch("cloudinit.config.cc_lxd.util")

Subscribers

People subscribed via source and target branches