Bug 768397 - subscription-manager facts --list fails when virt-what is not installed
Summary: subscription-manager facts --list fails when virt-what is not installed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager
Version: 5.8
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: 5.8
Assignee: Chris Duryee
QA Contact: Entitlement Bugs
URL:
Whiteboard:
Depends On:
Blocks: 715031 771700 772019
TreeView+ depends on / blocked
 
Reported: 2011-12-16 14:59 UTC by John Sefler
Modified: 2012-08-10 09:11 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
No description necessary
Clone Of:
Environment:
Last Closed: 2012-02-21 06:44:03 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0154 0 normal SHIPPED_LIVE subscription-manager bug fix update 2012-02-20 15:06:04 UTC

Description John Sefler 2011-12-16 14:59:42 UTC
Description of problem:
I suspect this commit https://bugzilla.redhat.com/show_bug.cgi?id=757697#c3 introduced a slight regression for the case when virt-what is not installed.

We have an automated test to assert that subscription-manager facts --list works properly when virt-what is not installed, but it caught the failure demonstrated below...


Version-Release number of selected component (if applicable):
[root@jsefler-onprem-5server ~]# rpm -q subscription-manager
subscription-manager-0.98.8-1.git.8.cfaa9c8.el5_7


How reproducible:


Steps to Reproduce:
[root@jsefler-onprem-5server ~]# which virt-what
/usr/sbin/virt-what
[root@jsefler-onprem-5server ~]# mv /usr/sbin/virt-what /usr/sbin/virt-what.bak

^^^ SIMULATION OF virt-what NOT BEING INSTALLED

[root@jsefler-onprem-5server ~]# subscription-manager facts --list
'virt.is_guest'
[root@jsefler-onprem-5server ~]# echo $?
255

^^^ DID NOT EXPECT facts --list TO FAIL WITH AN EXITCODE OF 255 AND NOT SHOW ANY FACTS IN STDOUT.  THE 'virt.is_guest' MESSAGE WAS WRITTEN TO STDERR.


[root@jsefler-onprem-5server ~]# mv /usr/sbin/virt-what.bak /usr/sbin/virt-what
[root@jsefler-onprem-5server ~]# subscription-manager facts --list
cpu.core(s)_per_socket: 1
cpu.cpu(s): 2
cpu.cpu_socket(s): 2
distribution.id: Tikanga
distribution.name: Red Hat Enterprise Linux Server
distribution.version: 5.8
dmi.bios.address: 0xe8000
dmi.bios.bios_revision: 1.0
dmi.bios.relase_date: 01/01/2007
dmi.bios.rom_size: 64 KB
dmi.bios.runtime_size: 96 KB
dmi.bios.vendor: QEMU
dmi.bios.version: QEMU
dmi.chassis.asset_tag: Not Specified
dmi.chassis.boot-up_state: Safe
dmi.chassis.lock: Not Present
dmi.chassis.manufacturer: Not Specified
dmi.chassis.power_supply_state: Safe
dmi.chassis.security_status: Unknown
dmi.chassis.serial_number: Not Specified
dmi.chassis.thermal_state: Safe
dmi.chassis.type: Other
dmi.chassis.version: Not Specified
dmi.memory.array_handle: 0x1000
dmi.memory.bank_locator: Not Specified
dmi.memory.data_width: 64 bit
dmi.memory.error_correction_type: Other
dmi.memory.error_information_handle: Not Provided
dmi.memory.form_factor: DIMM
dmi.memory.location: Other
dmi.memory.locator: DIMM 0
dmi.memory.maximum_capacity: 1 GB
dmi.memory.size: 1024 MB
dmi.memory.speed:   (ns)
dmi.memory.total_width: 64 bit
dmi.memory.type: RAM
dmi.memory.use: System Memory
dmi.processor.family: Other
dmi.processor.socket_designation: CPU 1
dmi.processor.status: Populated:Enabled
dmi.processor.type: Central Processor
dmi.processor.upgrade: Other
dmi.processor.version: Not Specified
dmi.processor.voltage: Unknown
dmi.system.family: Not Specified
dmi.system.manufacturer: Not Specified
dmi.system.product_name: Not Specified
dmi.system.serial_number: Not Specified
dmi.system.sku_number: Not Specified
dmi.system.status: No errors detected
dmi.system.uuid: 525e7383-f818-2531-bb17-d3669068973d
dmi.system.version: Not Specified
dmi.system.wake-up_type: Power Switch
memory.memtotal: 1025552
memory.swaptotal: 2064376
net.interface.eth0.broadcast: 10.16.120.255
net.interface.eth0.hwaddr: 52:54:00:1c:bd:ed
net.interface.eth0.ipaddr: 10.16.120.152
net.interface.eth0.netmask: 255.255.255.0
net.interface.lo.broadcast: 0.0.0.0
net.interface.lo.hwaddr: 00:00:00:00:00:00
net.interface.lo.ipaddr: 127.0.0.1
net.interface.lo.netmask: 255.0.0.0
net.interface.sit0.broadcast: Unknown
net.interface.sit0.hwaddr: 00:00:00:00:00:00
net.interface.sit0.ipaddr: Unknown
net.interface.sit0.netmask: Unknown
network.hostname: jsefler-onprem-5server
network.ipaddr: 127.0.0.1
system.entitlements_valid: invalid
uname.machine: x86_64
uname.nodename: jsefler-onprem-5server
uname.release: 2.6.18-294.el5
uname.sysname: Linux
uname.version: #1 SMP Tue Oct 25 16:30:40 EDT 2011
virt.host_type: kvm
virt.is_guest: True
virt.uuid: 525e7383-f818-2531-bb17-d3669068973d
[root@jsefler-onprem-5server ~]# echo $?
0


^^^^ WHEN virt-what IS NOT INSTALLED, I EXPECT TO SEE A FULL FACTS REPORT LISTED SIMILAR TO THAT.

PREVIOUSLY, THE VALUE FOR virt.is_guest USED TO REPORT "Unknown" WHEN virt-what IS NOT INSTALLED.

Comment 1 John Sefler 2011-12-16 15:09:17 UTC
In addition to the case when virt-what is not installed is the case when virt-what returns a failure (exitCode 255).  Subscription-manager used to also treat this case with a fact value of virt.is_guest=Unknown

Comment 3 Chris Duryee 2011-12-16 19:34:16 UTC
0fb291c4 master 0.99.1+
5a1b14b  RHEL5.8 0.98.8+

Comment 5 John Sefler 2011-12-20 19:08:37 UTC
Verifying Version...
[root@jsefler-onprem-5server ~]# rpm -q subscription-manager
subscription-manager-0.98.9-1.git.0.ca56fd1.el5_7

[root@jsefler-onprem-5server ~]# mv /usr/sbin/virt-what /usr/sbin/virt-what.bak
[root@jsefler-onprem-5server ~]# virt-what
-bash: virt-what: command not found
[root@jsefler-onprem-5server ~]# subscription-manager facts --list
cpu.core(s)_per_socket: 1
cpu.cpu(s): 2
cpu.cpu_socket(s): 2
distribution.id: Tikanga
distribution.name: Red Hat Enterprise Linux Server
distribution.version: 5.8
dmi.bios.address: 0xe8000
dmi.bios.bios_revision: 1.0
dmi.bios.relase_date: 01/01/2007
dmi.bios.rom_size: 64 KB
dmi.bios.runtime_size: 96 KB
dmi.bios.vendor: QEMU
dmi.bios.version: QEMU
dmi.chassis.asset_tag: Not Specified
dmi.chassis.boot-up_state: Safe
dmi.chassis.lock: Not Present
dmi.chassis.manufacturer: Not Specified
dmi.chassis.power_supply_state: Safe
dmi.chassis.security_status: Unknown
dmi.chassis.serial_number: Not Specified
dmi.chassis.thermal_state: Safe
dmi.chassis.type: Other
dmi.chassis.version: Not Specified
dmi.memory.array_handle: 0x1000
dmi.memory.bank_locator: Not Specified
dmi.memory.data_width: 64 bit
dmi.memory.error_correction_type: Other
dmi.memory.error_information_handle: Not Provided
dmi.memory.form_factor: DIMM
dmi.memory.location: Other
dmi.memory.locator: DIMM 0
dmi.memory.maximum_capacity: 1 GB
dmi.memory.size: 1024 MB
dmi.memory.speed:   (ns)
dmi.memory.total_width: 64 bit
dmi.memory.type: RAM
dmi.memory.use: System Memory
dmi.processor.family: Other
dmi.processor.socket_designation: CPU 1
dmi.processor.status: Populated:Enabled
dmi.processor.type: Central Processor
dmi.processor.upgrade: Other
dmi.processor.version: Not Specified
dmi.processor.voltage: Unknown
dmi.system.family: Not Specified
dmi.system.manufacturer: Not Specified
dmi.system.product_name: Not Specified
dmi.system.serial_number: Not Specified
dmi.system.sku_number: Not Specified
dmi.system.status: No errors detected
dmi.system.uuid: 525e7383-f818-2531-bb17-d3669068973d
dmi.system.version: Not Specified
dmi.system.wake-up_type: Power Switch
memory.memtotal: 1025552
memory.swaptotal: 2064376
net.interface.eth0.broadcast: 10.16.120.255
net.interface.eth0.hwaddr: 52:54:00:1c:bd:ed
net.interface.eth0.ipaddr: 10.16.120.152
net.interface.eth0.netmask: 255.255.255.0
net.interface.lo.broadcast: 0.0.0.0
net.interface.lo.hwaddr: 00:00:00:00:00:00
net.interface.lo.ipaddr: 127.0.0.1
net.interface.lo.netmask: 255.0.0.0
net.interface.sit0.broadcast: Unknown
net.interface.sit0.hwaddr: 00:00:00:00:00:00
net.interface.sit0.ipaddr: Unknown
net.interface.sit0.netmask: Unknown
network.hostname: jsefler-onprem-5server
network.ipaddr: 127.0.0.1
system.entitlements_valid: invalid
system.name: jsefler-onprem-5server
system.uuid: 265901a0-c710-48d6-addb-d81a7f5b4e64
uname.machine: x86_64
uname.nodename: jsefler-onprem-5server
uname.release: 2.6.18-294.el5
uname.sysname: Linux
uname.version: #1 SMP Tue Oct 25 16:30:40 EDT 2011
virt.is_guest: Unknown
virt.uuid: Unknown

VERIFIED...  facts list successfully and virt.is_guest is reported as Unknown when virt-what fails

moving to VERIFIED

Comment 6 William Poteat 2012-01-23 16:32:36 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No description necessary

Comment 7 errata-xmlrpc 2012-02-21 06:44:03 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.

http://rhn.redhat.com/errata/RHBA-2012-0154.html


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