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

fix(util): Check if the zpool command is available before using it #4970

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cloudinit/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2670,6 +2670,11 @@ def get_device_info_from_zpool(zpool):
if not os.path.exists("/dev/zfs"):
LOG.debug("Cannot get zpool info, no /dev/zfs")
return None
if not subp.which("zpool"):
# lxd containers may have /dev/zfs but not necessarily the zpool
# command available (LP: #2055219)
LOG.debug("Cannot get zpool info, no zpool command available")
return None
try:
(zpoolstatus, err) = subp.subp(["zpool", "status", zpool])
except subp.ProcessExecutionError as err:
Expand Down
Loading