Bug 1041578 - NoneType' object has no attribute 'ChassisPackageType
Summary: NoneType' object has no attribute 'ChassisPackageType
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pywbem
Version: 20
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Michal Minar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-12 18:01 UTC by Russell Doty
Modified: 2014-03-15 15:21 UTC (History)
8 users (show)

Fixed In Version: pywbem-0.7.0-25.20131121svn626.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-03-15 15:21:19 UTC
Type: Bug


Attachments (Terms of Use)
Output of dmidecode (2.48 KB, application/octet-stream)
2014-01-21 17:05 UTC, Russell Doty
no flags Details
Dmidecode fromRHEL 7.0 Beta system (2.26 KB, application/octet-stream)
2014-01-24 15:29 UTC, Russell Doty
no flags Details

Description Russell Doty 2013-12-12 18:01:20 UTC
Description of problem:

Using the command $ lmi hwinfo fails with  'NoneType' object has no attribute 'ChassisPackageType'

Other commands such as $ lmi hwinfo cpu work correctly.

Version-Release number of selected component (if applicable):

openlmi-hardware-0.4.1-fc20
openlmi-scripts-0.2.4a-3.fc20
openlmi-tools-0.9-5.fc20


How reproducible:

Every time.

Steps to Reproduce:
1. Install openlmi-scripts*
2. run lmi hwinfo
3.

Actual results:

 'NoneType' object has no attribute 'ChassisPackageType'


Expected results:

Display of hwinfo output


Additional info:

hwinfo subcommands work.

running hwinfo against a remote RHEL 7 Beta system returns the same failure

Comment 1 Russell Doty 2013-12-13 14:30:41 UTC
Updated information: this is occurring on a bare metal system. Other people have indicated that the command works in virtual machines.

Comment 2 Russell Doty 2013-12-13 16:19:46 UTC
Update: in further testing, a remote RHEL 7 Beta system is working.

Using hwinfo against an F20 system:

hwinfo fails
hwinfo cpu success
hwinfo chassis success
hwinfo memory success
hwinfo system fail


AHA!

When logged in as a regular user, lmi hwinfo will prompt for username and password. It then succeeds.

When logged in as root, the lmi hwinfo does not prompt for username and fails.

The list of failures above occur when logged in as root.

Comment 3 Peter Schiffer 2014-01-20 14:53:41 UTC
Hi Russell,

please, could you provide following information?


 * Does the command lmi hwinfo fails also with selinux turned off?

 * Please, attach file dmidecode.out from: # dmidecode --dump-bin dmidecode.out

 * Attach output from following command executed in lmishell (c is connection):
> c.root.cimv2.LMI_Chassis.instances()[0].properties_dict()


Thanks,

peter

Comment 4 Russell Doty 2014-01-21 17:04:41 UTC
Working with the latest updates to F20, su to root, and SELinux in enforcing mode, I get:

lmi> hwinfo
ERROR: invocation failed for host "https://localhost": (1, u'CIM_ERR_FAILED: File "libComputerSystemProvider.so" was not found for provider module "ComputerSystemModule".')
There was 1 error:
host https://localhost
    CIM_ERR_FAILED: File "libComputerSystemProvider.so" was not found for provider module "ComputerSystemModule".: 

The same error occurs when SELinux is put into permissive mode.

When logged in as a normal user I get:

[rdoty@localhost ~]$ lmi
lmi> hwinfo
username: pegasus
password: 
                
Hostname:      localhost 
                
Chassis Type:  Desktop 
Manufacturer:  Gigabyte Technology Co., Ltd. 
Model:          (GA-MA78GM-S2H) 
Serial Number: Not Specified 
Asset Tag:     0 
                
CPU:           AMD Phenom(tm) 9550 Quad-Core Processor 
Topology:      1 cpu(s), 1 core(s), 1 thread(s) 
Max Freq:      3000 MHz 
Arch:          x86_64 
                
Memory:        4 GB 
Slots:         2 used, 4 total 
lmi> 


Output of the properties dictionary is:

> c.root.cimv2.LMI_Chassis.instances()[0].properties_dict()
NocaseDict({u'HotSwappable': None, u'Model': '', u'HealthState': None, u'CanBeFRUed': None, u'StatusDescriptions': None, u'Weight': None, u'ServiceDescriptions': None, u'Generation': None, u'PoweredOn': None, u'SerialNumber': u'Not Specified', u'Tag': u'0', u'ServicePhilosophy': None, u'Height': None, u'CommunicationStatus': None, u'SecurityBreach': None, u'CableManagementStrategy': None, u'PartNumber': None, u'VendorCompatibilityStrings': None, u'SKU': '', u'OtherIdentifyingInfo': None, u'MultipleSystemSupport': None, u'Caption': u'System Chassis', u'NumberOfPowerCords': None, u'VendorEquipmentType': None, u'ChassisTypes': None, u'RemovalConditions': 2L, u'OtherInputCurrentType': None, u'Version': '', u'Removable': None, u'VisibleAlarm': None, u'Status': None, u'DetailedStatus': None, u'Description': u'This object represents physical chassis of the system.', u'UserTracking': None, u'ChassisPackageType': 3L, u'OperationalStatus': None, u'Replaceable': None, u'HeatGeneration': None, u'ManufactureDate': None, u'InputVoltage': None, u'IsLocked': None, u'InstallDate': None, u'CreationClassName': u'LMI_Chassis', u'AudibleAlarm': None, u'OtherPackageType': None, u'Manufacturer': u'Gigabyte Technology Co., Ltd.', u'TypeDescriptions': None, u'ElementName': u'Desktop', u'InputCurrentType': None, u'Name': u'Desktop', u'InstanceID': u'LMI:LMI_Chassis:0', u'PrimaryStatus': None, u'UUID': u'30303146-4430-3541-3044-3130FFFFFFFF', u'ProductName': u'GA-MA78GM-S2H', u'LockPresent': False, u'Depth': None, u'PackageType': 3L, u'OperatingStatus': None, u'CurrentRequiredOrProduced': None, u'RackMountable': None, u'BreachDescription': None, u'ChassisTypeDescription': None, u'Width': None})

Comment 5 Russell Doty 2014-01-21 17:05:40 UTC
Created attachment 853362 [details]
Output of dmidecode

Comment 6 Russell Doty 2014-01-21 17:14:11 UTC
Connecting to a RHEL 7 beta system with SELinux in either enforcing or permissive mode:

]# lmi -nv -h 192.168.10.124
lmi> hwinfo
username: pegasus
password: 
INFO: Connected to 192.168.10.124
ERROR: invocation failed for host "https://192.168.10.124": 'NoneType' object has no attribute 'ChassisPackageType'
There was 1 error:
host https://192.168.10.124
    (AttributeError) 'NoneType' object has no attribute 'ChassisPackageType'
lmi> help hwinfo
Display hardware information.

Usage:
    hwinfo [all]
    hwinfo system
    hwinfo chassis
    hwinfo cpu
    hwinfo memory

Commands:
    all       Display all available information.
    system    Display system hostname.
    chassis   Display chassis information.
    cpu       Display processor information.
    memory    Display memory information.
lmi> hwinfo chassis
ERROR: invocation failed for host "https://192.168.10.124": 'NoneType' object has no attribute 'ChassisPackageType'
There was 1 error:
host https://192.168.10.124
    (AttributeError) 'NoneType' object has no attribute 'ChassisPackageType'
lmi> hwinfo system
           
Hostname: localhost 
lmi> hwinfo cpu
           
CPU:      AMD Phenom(tm) II X3 715 Processor 
Topology: 1 cpu(s), 3 core(s), 3 thread(s) 
Max Freq: 0 MHz 
Arch:     x86_64 
lmi> hwinfo memory
         
Memory: 7 GB 
Slots:  N/A used, N/A total 
lmi> hwinfo chassis
ERROR: invocation failed for host "https://192.168.10.124": 'NoneType' object has no attribute 'ChassisPackageType'
There was 1 error:
host https://192.168.10.124
    (AttributeError) 'NoneType' object has no attribute 'ChassisPackageType'
lmi> hwinfo cpu
           
CPU:      AMD Phenom(tm) II X3 715 Processor 
Topology: 1 cpu(s), 3 core(s), 3 thread(s) 
Max Freq: 0 MHz 
Arch:     x86_64 
lmi> hwinfo memory
         
Memory: 7 GB 
Slots:  N/A used, N/A total 
lmi>

Comment 7 Peter Schiffer 2014-01-22 14:22:40 UTC
Thanks Russell for the information. Could you also attach the following from the RHEL-7 machine?

 * File dmidecode.out from: # dmidecode --dump-bin dmidecode.out

 * Output from following command executed in lmishell (c is connection):
> c.root.cimv2.LMI_Chassis.instances()[0].properties_dict()

And, does it work when you run lmi as a regular user? E.g.:

$ whoami
somebody_not_root
$ lmi -nv -h 192.168.10.124
....

Thanks,

peter

Comment 8 Russell Doty 2014-01-24 15:29:45 UTC
Created attachment 855044 [details]
Dmidecode fromRHEL 7.0 Beta system

Comment 9 Russell Doty 2014-01-24 15:36:18 UTC
Running hwinfo against a remote RHEL 7.0 Beta system using lmi -nv -h 192.168.10.124 fails with  "(AttributeError) 'NoneType' object has no attribute 'ChassisPackageType'" both when running as a regular user and when running as root.

Running the individual hwinfo subcommands, the failure occurs with hwinfo chassis.

Comment 10 Russell Doty 2014-01-24 16:36:49 UTC
Chassis details from LMIShell:

> c.root.cimv2.LMI_Chassis.instances()[0].properties_dict()
NocaseDict({u'HotSwappable': None, u'Model': u'System Version', u'HealthState': None, u'CanBeFRUed': None, u'StatusDescriptions': None, u'Weight': None, u'ServiceDescriptions': None, u'Generation': None, u'PoweredOn': None, u'SerialNumber': u'Chassis Serial Number', u'Tag': u'Asset-1234567890', u'ServicePhilosophy': None, u'Height': None, u'CommunicationStatus': None, u'SecurityBreach': None, u'CableManagementStrategy': None, u'PartNumber': None, u'VendorCompatibilityStrings': None, u'SKU': '', u'OtherIdentifyingInfo': None, u'MultipleSystemSupport': None, u'Caption': u'System Chassis', u'NumberOfPowerCords': 1L, u'VendorEquipmentType': None, u'ChassisTypes': None, u'RemovalConditions': 2L, u'OtherInputCurrentType': None, u'Version': u'Chassis Version', u'Removable': None, u'VisibleAlarm': None, u'Status': None, u'DetailedStatus': None, u'Description': u'This object represents physical chassis of the system.', u'UserTracking': None, u'ChassisPackageType': 3L, u'OperationalStatus': None, u'Replaceable': None, u'HeatGeneration': None, u'ManufactureDate': None, u'InputVoltage': None, u'IsLocked': None, u'InstallDate': None, u'CreationClassName': u'LMI_Chassis', u'AudibleAlarm': None, u'OtherPackageType': None, u'Manufacturer': u'Chassis Manufacture', u'TypeDescriptions': None, u'ElementName': u'Desktop', u'InputCurrentType': None, u'Name': u'Desktop', u'InstanceID': u'LMI:LMI_Chassis:Asset-1234567890', u'PrimaryStatus': None, u'UUID': u'A044D9B3-40EE-DF11-864C-BCAEC5186012', u'ProductName': u'System Product Name', u'LockPresent': False, u'Depth': None, u'PackageType': 3L, u'OperatingStatus': None, u'CurrentRequiredOrProduced': None, u'RackMountable': None, u'BreachDescription': None, u'ChassisTypeDescription': None, u'Width': None})

Comment 11 Russell Doty 2014-01-24 16:44:17 UTC
Looks like a SELinux issue.

Default RHEL 7.0 Beta configuration: fails
setenforce 0: works
setenforce 1: fails

Comment 12 Russell Doty 2014-01-24 17:31:03 UTC
Installed updated SELinux policy:

selinux-policy/3.12.1/120.el7/noarch/selinux-policy-3.12.1-120.el7.noarch.rpm
selinux-policy/3.12.1/120.el7/noarch/selinux-policy-targeted-3.12.1-120.el7.noarch.rpm

With these changes the lmi hwinfo command now works with SELinux in enforcing mode.

Comment 13 Russell Doty 2014-01-24 17:41:18 UTC
Output of hwinfo after installing the updated SELinux policies:

lmi> hwinfo
username: pegasus
password: 
INFO: Connected to 192.168.10.124
                
Hostname:      localhost 
                
Chassis Type:  Desktop 
Manufacturer:  Chassis Manufacture 
Model:         System Version (System Product Name) 
Serial Number: Chassis Serial Number 
Asset Tag:     Asset-1234567890 
                
CPU:           AMD Phenom(tm) II X3 715 Processor 
Topology:      1 cpu(s), 3 core(s), 1 thread(s) 
Max Freq:      2800 MHz 
Arch:          x86_64 
                
Memory:        8 GB 
Slots:         4 used, N/A total

Comment 14 Peter Schiffer 2014-01-27 17:07:19 UTC
Thanks Russell.

Now, the only problem left is this one:

lmi> hwinfo
ERROR: invocation failed for host "https://localhost": (1, u'CIM_ERR_FAILED: File "libComputerSystemProvider.so" was not found for provider module "ComputerSystemModule".')
There was 1 error:
host https://localhost
    CIM_ERR_FAILED: File "libComputerSystemProvider.so" was not found for provider module "ComputerSystemModule".: 

I'm reassigning this bug to Michal.

Comment 16 Michal Minar 2014-02-24 10:51:58 UTC
Pure pywbem reproducer:

# first login as non-root
su  # then change to root
cat >reproducer.py <<EOF
#!/usr/bin/env python

import pywbem

conn = pywbem.PegasusUDSConnection()
inames = conn.EnumerateInstanceNames('PG_ComputerSystem', namespace='root/cimv2')
print inames[0]['Name']
EOF
python reproducer.py

Comment 17 Fedora Update System 2014-02-24 11:32:40 UTC
pywbem-0.7.0-25.20131121svn626.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/pywbem-0.7.0-25.20131121svn626.fc20

Comment 18 Fedora Update System 2014-02-25 07:56:56 UTC
Package pywbem-0.7.0-25.20131121svn626.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing pywbem-0.7.0-25.20131121svn626.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-3067/pywbem-0.7.0-25.20131121svn626.fc20
then log in and leave karma (feedback).

Comment 19 Fedora Update System 2014-03-15 15:21:19 UTC
pywbem-0.7.0-25.20131121svn626.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


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