Bug 1247066 - Suggest to put "uuid" ahead of "guests" when print the host/guests association in JSON format to stdout
Suggest to put "uuid" ahead of "guests" when print the host/guests associati...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-who (Show other bugs)
7.2
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Radek Novacek
xingge
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-27 05:19 EDT by Liushihui
Modified: 2016-11-30 19:33 EST (History)
5 users (show)

See Also:
Fixed In Version: virt-who-0.14-3.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-19 06:57:27 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Liushihui 2015-07-27 05:19:07 EDT
Description of problem:
When print the host/guests association in JSON format to stdout(virt-who -p), I suggest to put host's "uuid"  ahead of "guests" since it's the key attribute.

Version-Release number of selected component (if applicable):
virt-who-0.14-2.el7.noarch
subscription-manager-1.15.6-1.el7.x86_64
python-rhsm-1.15.3-1.el7.x86_64
Satellite-6.1.0-RHEL-7-20150721.7

How reproducible:
Always

Steps to Reproduce:
1.Register system to satellite
2.Print the host/guests association in JSON format to stdout.
[root@hp-z220-06 virt-who.d]# virt-who --esx --esx-owner=ACME_Corporation --esx-env=Library --esx-server=10.66.79.57 --esx-username=Administrator@vsphere.local --esx-password=qwer1234P! -p -d > /root/ddd
2015-07-27 15:27:39,998 INFO: Using configuration "env/cmdline" ("esx" mode)
2015-07-27 15:27:40,028 DEBUG: Log into ESX
2015-07-27 15:27:40,661 DEBUG: Creating ESX event filter
2015-07-27 15:27:40,747 DEBUG: Association for config env/cmdline gathered
2015-07-27 15:27:40,748 DEBUG: Associations found: {
    "hypervisors": [
        {
            "guests": [
                {
                    "attributes": {
                        "active": 0, 
                        "virtWhoType": "esx"
                    }, 
                    "guestId": "564dab7d-3b72-51a1-eeda-586036106892", 
                    "state": 5
                }, 
            ], 
            "uuid": "aee4ff00-8c33-11e2-994a-6c3be51d959a"
        },
    ]
}

Actual results:
Host's "uuid" behind of the "guests" since host uuid is the key attribute.

Expected results:
Host's "uuid" should ahead of the "guests" since host uuid is the key attribute.

Additional info:
Comment 1 Radek Novacek 2015-07-30 09:16:46 EDT
Fixed in virt-who-0.14-3.el7.
Comment 3 Liushihui 2015-08-11 02:10:28 EDT
Verified it on virt-who-0.14-3.el7.noarch since "guestId" and "state" have been put ahead of the "guests"

Verified version
virt-who-0.14-3.el7.noarch
subscription-manager-1.15.9-2.el7.x86_64
python-rhsm-1.15.4-2.el7.x86_64
Satellite 6.1.0-20150731.0

Verified process:
1.Register system to satellite
2.Print the host/guests association in JSON format to stdout.
[root@hp-z220-07 ~]# virt-who --esx --esx-owner=ACME_Corporation --esx-env=Library --esx-server=10.66.78.97 --esx-username=Administrator@vsphere.local --esx-password=qwer1234P! -p -d > /root/ddd
2015-08-11 14:05:48,254 DEBUG: Using config named 'test-esx1'
2015-08-11 14:05:48,254 INFO: Using configuration "test-esx1" ("esx" mode)
2015-08-11 14:05:48,255 INFO: Using configuration "env/cmdline" ("esx" mode)
2015-08-11 14:05:48,285 DEBUG: Log into ESX
2015-08-11 14:05:48,286 DEBUG: Log into ESX
2015-08-11 14:05:48,484 DEBUG: Creating ESX event filter
2015-08-11 14:05:48,484 DEBUG: Creating ESX event filter
2015-08-11 14:05:48,549 DEBUG: Association for config env/cmdline gathered
2015-08-11 14:05:48,552 DEBUG: Association for config test-esx1 gathered
2015-08-11 14:05:48,553 DEBUG: Associations found: {
    "hypervisors": [
        {
            "uuid": "86b2bd00-8bad-11e2-87f4-6c3be514699d", 
            "guests": [
                {
                    "guestId": "42390187-0ca7-6139-dadb-549a990f34e3", 
                    "state": 5, 
                    "attributes": {
                        "active": 0, 
                        "virtWhoType": "esx"
                    }
                }, 
                {
                    "guestId": "564d1d17-06d9-46c3-beea-fed130d564e7", 
                    "state": 5, 
                    "attributes": {
                        "active": 0, 
                        "virtWhoType": "esx"
                    }
                }, 
                {
                    "guestId": "4239d107-b6b3-ec67-3317-678288dafe5a", 
                    "state": 5, 
                    "attributes": {
                        "active": 0, 
                        "virtWhoType": "esx"
                    }
                }
            ]
        }, 
        {
            "uuid": "86b2bd00-8bad-11e2-87f4-6c3be514699d", 
            "guests": [
                {
                    "guestId": "42390187-0ca7-6139-dadb-549a990f34e3", 
                    "state": 5, 
                    "attributes": {
                        "active": 0, 
                        "virtWhoType": "esx"
                    }
                }, 
                {
                    "guestId": "564d1d17-06d9-46c3-beea-fed130d564e7", 
                    "state": 5, 
                    "attributes": {
                        "active": 0, 
                        "virtWhoType": "esx"
                    }
                }, 
                {
                    "guestId": "4239d107-b6b3-ec67-3317-678288dafe5a", 
                    "state": 5, 
                    "attributes": {
                        "active": 0, 
                        "virtWhoType": "esx"
                    }
                }
            ]
        }
    ]
}

Result: 
Host's "uuid" has been ahead of the "guests", Therefore,verify it .
Comment 4 errata-xmlrpc 2015-11-19 06:57:27 EST
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-2370.html

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