Public bug reported:
When running virt-sysprep on a VM file containing an fstab, with entries
with multiple options, it will fail with "guestfsd: error: aug_get:
/files/etc/fstab/1/opt: Too many matches for path expression: There are
2 nodes matching /files/etc/fstab/1/opt", or a similar error.
Augeas' aug_get only returns the value for a single node, and will fail
with an error if there are multiple matches for the string. In this
case, the nodes "/files/etc/fstab/1/opt[1]" and
"/files/etc/fstab/1/opt[2]" exists and aug_get /files/etc/fstab/1/opt
will match both of these nodes.
It appears that libguestfs does "aug_match /files/etc/fstab/1/opt" to
get the nodes for all the options for the first entry (and so on), but
it then runs "aug_get /files/etc/fstab/1/opt", which returns an error. I
suspect that it's supposed to get the first option instead
(/files/etc/fstab/1/opt[1]).
Ubuntu version: Ubuntu 16.04 LTS
libguestfs0 version: 1:1.32.2-4ubuntu2
libguestfs-tools version: 1:1.32.2-4ubuntu2
Additional information:
The image file in question is a qcow2 image file, with Ubuntu 16.04 "xenial"
installed.
The partitions present on the qcow2 image are a FAT32 EFI System Partition, and
a btrfs root filesystem with two subvolumes: @ (for /), and @home (for /home).
The fstab present on the installation of Ubuntu contains multiple fstab entries
with multiple options, e.g. "relatime,subvol=@" for /
** Affects: libguestfs (Ubuntu)
Importance: Undecided
Status: New
** Tags: virt-sysprep xenial
** Attachment added: "output of virt-sysprep -a -v -x ubuntu-xenial-base.qcow2"
https://bugs.launchpad.net/bugs/1615337/+attachment/4724900/+files/virt-sysprep.log
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1615337
Title:
libguestfs uses aug_get to get /files/etc/fstab/X/opt instead
/files/etc/fstab/X/opt[Y]
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libguestfs/+bug/1615337/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs