RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1140547 - virt-builder option '--format' don't work well
Summary: virt-builder option '--format' don't work well
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.1
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-11 08:30 UTC by Lingfei Kong
Modified: 2015-03-05 13:44 UTC (History)
4 users (show)

Fixed In Version: libguestfs-1.27.43-1.1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 13:44:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0303 0 normal SHIPPED_LIVE libguestfs bug fix and enhancement update 2015-03-05 17:34:44 UTC

Description Lingfei Kong 2014-09-11 08:30:22 UTC
Description of problem:
virt-builder option '--list --format' don't work well. Also i can find the following use with '--format':
# virt-builder fedora-20 --format qcow2

That is to say --format can used for different purpose, i don't know if this is the original design for --format option.


Version-Release number of selected component (if applicable):
libguestfs-1.27.39-1.1.el7


How reproducible:
100%


Steps to Reproduce:
#virt-builder --list --format short
gpg: Signature made Tue 08 Jul 2014 05:11:00 PM CST using RSA key ID E1B768A0
gpg: Good signature from "Richard W.M. Jones <rjones>"
gpg:                 aka "Richard W.M. Jones <rich>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: F777 4FB1 AD07 4A7E 8C87  67EA 9173 8F73 E1B7 68A0
centos-6                 x86_64     CentOS 6.5
centos-7.0               x86_64     CentOS 7.0
cirros-0.3.1             x86_64     CirrOS 0.3.1
debian-6                 x86_64     Debian 6 (Squeeze)
debian-7                 x86_64     Debian 7 (Wheezy)
fedora-18                x86_64     Fedora® 18
fedora-19                x86_64     Fedora® 19
fedora-20                x86_64     Fedora® 20
rhel-7rc                 x86_64     Red Hat Enterprise Linux® 7 Release Candidate
scientificlinux-6        x86_64     Scientific Linux 6.5
ubuntu-10.04             x86_64     Ubuntu 10.04 (Lucid)
ubuntu-12.04             x86_64     Ubuntu 12.04 (Precise)
ubuntu-14.04             x86_64     Ubuntu 14.04 (Trusty)
#virt-builder --list --format long
gpg: Signature made Tue 08 Jul 2014 05:11:00 PM CST using RSA key ID E1B768A0
gpg: Good signature from "Richard W.M. Jones <rjones>"
gpg:                 aka "Richard W.M. Jones <rich>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: F777 4FB1 AD07 4A7E 8C87  67EA 9173 8F73 E1B7 68A0
centos-6                 x86_64     CentOS 6.5
centos-7.0               x86_64     CentOS 7.0
cirros-0.3.1             x86_64     CirrOS 0.3.1
debian-6                 x86_64     Debian 6 (Squeeze)
debian-7                 x86_64     Debian 7 (Wheezy)
fedora-18                x86_64     Fedora® 18
fedora-19                x86_64     Fedora® 19
fedora-20                x86_64     Fedora® 20
rhel-7rc                 x86_64     Red Hat Enterprise Linux® 7 Release Candidate
scientificlinux-6        x86_64     Scientific Linux 6.5
ubuntu-10.04             x86_64     Ubuntu 10.04 (Lucid)
ubuntu-12.04             x86_64     Ubuntu 12.04 (Precise)
ubuntu-14.04             x86_64     Ubuntu 14.04 (Trusty)
#virt-builder --list --format json
gpg: Signature made Tue 08 Jul 2014 05:11:00 PM CST using RSA key ID E1B768A0
gpg: Good signature from "Richard W.M. Jones <rjones>"
gpg:                 aka "Richard W.M. Jones <rich>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: F777 4FB1 AD07 4A7E 8C87  67EA 9173 8F73 E1B7 68A0
centos-6                 x86_64     CentOS 6.5
centos-7.0               x86_64     CentOS 7.0
cirros-0.3.1             x86_64     CirrOS 0.3.1
debian-6                 x86_64     Debian 6 (Squeeze)
debian-7                 x86_64     Debian 7 (Wheezy)
fedora-18                x86_64     Fedora® 18
fedora-19                x86_64     Fedora® 19
fedora-20                x86_64     Fedora® 20
rhel-7rc                 x86_64     Red Hat Enterprise Linux® 7 Release Candidate
scientificlinux-6        x86_64     Scientific Linux 6.5
ubuntu-10.04             x86_64     Ubuntu 10.04 (Lucid)
ubuntu-12.04             x86_64     Ubuntu 12.04 (Precise)
ubuntu-14.04             x86_64     Ubuntu 14.04 (Trusty)

Actual results:
The output format of virt-builder --list --format short, virt-builder --list --format long, virt-builder --list --format json are all short

Expected results:
The output of virt-builder --list --format short, virt-builder --list --format long, virt-builder --list --format json have a correct format

Additional info:

Comment 2 Richard W.M. Jones 2014-09-11 08:42:20 UTC
The option is --list-format (not --list --format).  eg:

$ virt-builder -l --list-format json
{
  "version": 1,
  "sources": [
  {
    "key": "/etc/xdg/virt-builder/repos.d/libguestfs.gpg",
    "uri": "http://libguestfs.org/download/builder/index.asc"
  },
  {
    "uri": "http://file.rdu.redhat.com/~rjones/builder/index.asc"
  }
  ],
[etc]

However I agree that we probably should reject the '--format'
option when the mode is '--list'.

Comment 3 Lingfei Kong 2014-09-11 09:09:32 UTC
(In reply to Richard W.M. Jones from comment #2)
> The option is --list-format (not --list --format).  eg:
> 

Thanks for your quickly response, i checked the man page, found the following lines:
       --list --format format
       --list --long
           List available templates.

           It is possible to choose with --format the output format for the list templates:

           short
               The default format, prints only the template identifier and, next to it, its short
               description.

           long
               Prints a textual list with the details of the available sources, followed by the details of
               the available templates.

           json
               Prints a JSON object with the details of the available sources and the details of the
               available templates.

               The "version" key in the main object represents the "compatibility version", and it is bumped
               every time the resulting JSON output is incompatible with the previous versions (for example
               the structure has changed, or non-optional keys are no more present).


Maybe the man page should change '--list --format format' to '--list --list-format format'

Comment 4 Richard W.M. Jones 2014-09-11 09:15:57 UTC
I've fixed the incorrect documentation in the manual page and added
an extra error message if people use --list + --format:

https://github.com/libguestfs/libguestfs/commit/de3614e0ff67f5a85625946f35af296080cbb6b8

Comment 6 Lingfei Kong 2014-10-22 07:58:51 UTC
Verify with libguestfs-1.28.1-1.2.el7

Steps to verify:
1. #virt-builder --list --list-format json
{
  "version": 1,
  "sources": [
    {
      "uri": "file:///var/run/guestfs-autotest/images/index.asc"
    }
  ],
  "templates": [
    {
      "os-version": "RHEL_7u0_Server",
      "full-name": "RHEL_7u0_Server",
      "arch": "x86_64",
      "size": 8589934592,
      "notes": {
        "C": "RHEL_7u0_Server"
      },
      "hidden": false
    }
  ]
}


2. #virt-builder --list --format short
virt-builder: virt-builder --list: use '--list-format', not '--format'.

3. Check man page of virt-builder, the man page have changed to the right format: 
 -l
       --list
       --list --list-format format
       --list --long
           List available templates.

           It is possible to choose with --list-format the output format for the list templates:

           short
               The default format, prints only the template identifier and, next to it, its short
               description.
           .......

According to step 1, step 2, step 3, this bug is fixed.

Comment 8 errata-xmlrpc 2015-03-05 13:44:29 UTC
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://rhn.redhat.com/errata/RHBA-2015-0303.html


Note You need to log in before you can comment on or make changes to this bug.