Bug 1351000
Summary: | virt-customize --commands-from-file will fail if there is an extra blank in the file | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Xianghua Chen <xchen> |
Component: | libguestfs | Assignee: | Pino Toscano <ptoscano> |
Status: | CLOSED ERRATA | QA Contact: | YongkuiGuo <yoguo> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 8.0 | CC: | jsuchane, linl, mkletzan, ptoscano, rjones, wshi, yoguo |
Target Milestone: | rc | ||
Target Release: | 8.1 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libguestfs-1.40.2-21.module+el8.2.0+5851+8d6a931b | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-05-05 09:43:16 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Xianghua Chen
2016-06-29 02:00:18 UTC
Patch posted upstream: https://www.redhat.com/archives/libguestfs/2020-January/msg00180.html Fixed upstream with https://github.com/libguestfs/libguestfs-common/commit/12f3fb0f6ccdacb4c6fb81385550b62665fc1497 Try to verify this bug with package: libguestfs-1.40.2-21.module+el8.2.0+5851+8d6a931b.x86_64 Steps: 1. Create a script file and there are whitespaces before the first command line # cat test.sh mkdir /root/dir1 write /root/dir1/file1:"test file1" 2. # virt-customize -a RHEL-Server-8.2.0-64-20191203.0-hvm.raw --commands-from-file test.sh [ 0.0] Examining the guest ... [ 8.4] Setting a random seed [ 8.4] Making directory: /root/dir1 [ 8.4] Writing: /root/dir1/file1 [ 8.5] Finishing off It works. 3. Change the test.sh and add whitespace between the install command and its argument. # cat test.sh install git mkdir /root/dir1 write /root/dir1/file1:"test file1" 4. # virt-customize -a RHEL-Server-8.2.0-64-20191203.0-hvm.raw --commands-from-file test.sh [ 0.0] Examining the guest ... [ 8.0] Setting a random seed [ 8.1] Installing packages: git ... No match for argument: git Error: Unable to find a match: git virt-customize: error: dnf -y install ' git': command exited with an error If reporting bugs, run virt-customize with debugging enabled and include the complete output: virt-customize -v -x [...] It failed due to the extra whitespace before the argument. (In reply to YongkuiGuo from comment #5) > 3. Change the test.sh and add whitespace between the install command and its > argument. > # cat test.sh > install git > mkdir /root/dir1 > write /root/dir1/file1:"test file1" > > 4. > # virt-customize -a RHEL-Server-8.2.0-64-20191203.0-hvm.raw > --commands-from-file test.sh > [ 0.0] Examining the guest ... > [ 8.0] Setting a random seed > [ 8.1] Installing packages: git > ... > No match for argument: git > Error: Unable to find a match: git > virt-customize: error: dnf -y install ' git': command exited with an error This was not what this bug was about, and indeed it was not covered by the fix. The fix is only about the whitespaces before the command. (In reply to Pino Toscano from comment #6) > (In reply to YongkuiGuo from comment #5) > > 3. Change the test.sh and add whitespace between the install command and its > > argument. > > # cat test.sh > > install git > > mkdir /root/dir1 > > write /root/dir1/file1:"test file1" > > > > 4. > > # virt-customize -a RHEL-Server-8.2.0-64-20191203.0-hvm.raw > > --commands-from-file test.sh > > [ 0.0] Examining the guest ... > > [ 8.0] Setting a random seed > > [ 8.1] Installing packages: git > > ... > > No match for argument: git > > Error: Unable to find a match: git > > virt-customize: error: dnf -y install ' git': command exited with an error > > This was not what this bug was about, and indeed it was not covered by the > fix. > The fix is only about the whitespaces before the command. I saw this type of whitespace is included in the reproducible steps of the reporter(comment 0). Should we open a new bug for tracking this issue? (In reply to YongkuiGuo from comment #7) > I saw this type of whitespace is included in the reproducible steps of the > reporter(comment 0). Should we open a new bug for tracking this issue? Martin? Even though it is almost the same thing from the users' perspective, it is slightly different thing in the code. I don't have a preference of whether we need another BZ or not, but it is not going to be fixed anyway. I would say if you want that fixed than file another BZ with some reasoning behind that change. Otherwise just leave it as it is and we can close this one. The whitespace is just treated as part of the argument and I did not find any mention about them being supported in a way that would allow indentation or anything else. The original problem was good to get fixed since it did not provide a useful error message. This one, however, feels pointless to spent time on IMNSHO. But thanks for trying it out. According to comment 5 and comment 9, i will verify this bug. Thanks pino and martin for the explanation. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2017 |