AttributeError when no Physical Drive serial returned

Bug #1550328 reported by Vil Surkin
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-dracclient
Fix Released
High
Dmitry Tantsur

Bug Description

Sometimes idrac doesn't know physical drive serial number (in my case it is H730 ctl and Crucial CT960M50 SSD). If so, `list_physical_disks()` definition throws an exception:

```
Traceback (most recent call last):
  [ ... ]
  File "../venv/lib/python2.7/site-packages/dracclient/client.py", line 324, in list_physical_disks
    return self._raid_mgmt.list_physical_disks()
  File "../venv/lib/python2.7/site-packages/dracclient/resources/raid.py", line 200, in list_physical_disks
    for disk in drac_physical_disks]
  File "../venv/lib/python2.7/site-packages/dracclient/resources/raid.py", line 227, in _parse_drac_physical_disk
    'SerialNumber'),
  File "../venv/lib/python2.7/site-packages/dracclient/resources/raid.py", line 235, in _get_physical_disk_attr
    drac_disk, uris.DCIM_PhysicalDiskView, attr_name)
  File "../venv/lib/python2.7/site-packages/dracclient/utils.py", line 61, in get_wsman_resource_attr
    return item.text.strip()
AttributeError: 'NoneType' object has no attribute 'strip'
```

Imre Farkas (ifarkas)
Changed in python-dracclient:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Anish Bhatt (anish7) wrote :

Hit this one as well, will submit fix.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-dracclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/389368

Changed in python-dracclient:
assignee: nobody → Anish Bhatt (anish7)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-dracclient (master)

Reviewed: https://review.openstack.org/389368
Committed: https://git.openstack.org/cgit/openstack/python-dracclient/commit/?id=5804c28b5f13fc7637a2b0216c05a8ed6476929c
Submitter: Jenkins
Branch: master

commit 5804c28b5f13fc7637a2b0216c05a8ed6476929c
Author: Anish Bhatt <email address hidden>
Date: Mon Sep 26 23:10:49 2016 -0700

    Raid controller and Physical Drive attributes need to be nullable

    This can fail with
    AttributeError: 'NoneType' object has no attribute 'strip'
    otherwise

    Closes-Bug: #1550328
    Change-Id: I8eafe606407cddc1e9ea03a33473b65ff3b59384

Changed in python-dracclient:
status: In Progress → Fix Released
Dmitry Tantsur (divius)
Changed in python-dracclient:
status: Fix Released → In Progress
assignee: Anish Bhatt (anish7) → Dmitry Tantsur (divius)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-dracclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/394465

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-dracclient (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/394466

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-dracclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/394510

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-dracclient (master)

Reviewed: https://review.openstack.org/394465
Committed: https://git.openstack.org/cgit/openstack/python-dracclient/commit/?id=ba1eb4aa99db7b78168ff2b0d19918924a0cb2aa
Submitter: Jenkins
Branch: master

commit ba1eb4aa99db7b78168ff2b0d19918924a0cb2aa
Author: Dmitry Tantsur <email address hidden>
Date: Mon Nov 7 15:36:04 2016 +0100

    Raise a reasonable error on non-nullable flags with empty text

    Now it fails with AttributeError: 'NoneType' object has no attribute 'strip'.
    Raise a new exception with proper explanation instead.

    Partial-Bug: #1550328
    Change-Id: Ie9f9d212c934bb75e8224dd64ec8df7f788b86d3

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-dracclient (master)

Reviewed: https://review.openstack.org/394466
Committed: https://git.openstack.org/cgit/openstack/python-dracclient/commit/?id=aeebdf890bfc25d42a8df8958f36c3347252c0a8
Submitter: Jenkins
Branch: master

commit aeebdf890bfc25d42a8df8958f36c3347252c0a8
Author: Dmitry Tantsur <email address hidden>
Date: Mon Nov 7 15:47:44 2016 +0100

    Raise a specific exception instead of generic AttributeError

    Currently we raise an AttributeError when expected attribute is missing
    from the response. This is not very developer-friendly, so this patch
    creates a new exception (derived from AttributeError for compatibility)
    for this purpose.

    Change-Id: If2ac03dcd410d451dc7bbfe7bbd0b145da201c9a
    Related-Bug: #1550328

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-dracclient (master)

Reviewed: https://review.openstack.org/394510
Committed: https://git.openstack.org/cgit/openstack/python-dracclient/commit/?id=4fbea94a1c0ccf7ca4ab3416f2949975d9fc3077
Submitter: Jenkins
Branch: master

commit 4fbea94a1c0ccf7ca4ab3416f2949975d9fc3077
Author: Dmitry Tantsur <email address hidden>
Date: Mon Nov 7 15:55:47 2016 +0100

    Make name and description nullable for virtual disks

    This change fixes inspection failure on my hardware.
    In the future we should develop a better understanding on which
    fields are mandatory and which are not, as right now we're very
    inconsistent with handling them.

    Change-Id: Ia2af90fec4eef168953552a947933617e7c808d0
    Closes-Bug: #1550328

Changed in python-dracclient:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.