init_host() raises meaningless exception

Bug #1659037 reported by Andreas Maier
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
nova-dpm
Fix Released
Medium
sreeteja

Bug Description

The driver function init_host() invokes:

       self._cpc = self._client.cpcs.find(**{
            "object-id": self._conf['cpc_uuid']})

For the code, see here: https://github.com/openstack/nova-dpm/blob/886fa3ae007589de2d41d7b345ae105cdc72c6bb/nova_dpm/virt/dpm/driver.py#L84

This code does not catch the zhmcclient.NotFound exception that will be raised if the CPC is not found.

The issue with this code is that this exception does not have a message text and therefore it will be hard from the nova log file to figure out what the reason was for the problem.

There can be various reasons why the CPC was not found:
* Wrong HMC host was configured in the config file.
* CPC UUID was mistyped in the config file.
* HMC user does not have object-access permission for the CPC.

The code quoted above should be protected by having a try-except block around it that catches zhmcclient.NotFound, and that raises an appropriate exception with a message text that mentions that the configured CPC was not found, and that includes the HMC host, HMC userid and CPC UUID that were used.

Andreas Maier (maiera)
description: updated
Changed in nova-dpm:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova-dpm (master)

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

Changed in nova-dpm:
assignee: nobody → Juergen Leopold (leopoldj)
status: New → In Progress
sreeteja (sreeteja)
Changed in nova-dpm:
assignee: Juergen Leopold (leopoldj) → sreeteja (sreeteja)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova-dpm (master)

Reviewed: https://review.openstack.org/457569
Committed: https://git.openstack.org/cgit/openstack/nova-dpm/commit/?id=ff1b77f71a72d6f812f8ebe0d6f72b0d3259c894
Submitter: Jenkins
Branch: master

commit ff1b77f71a72d6f812f8ebe0d6f72b0d3259c894
Author: Juergen Leopold <email address hidden>
Date: Tue Apr 18 10:04:53 2017 +0000

    Handles exception in init_host() if CPC is not found

    This code writes an error log in the nova log
    if the CPC is not found in the init_host() method
    of the DPMDriver. This will help to debug problems.
    The error message contains information about the
    HMC host, HMC userid and CPC UUID that were used.

    Closes-Bug: #1659037

    Change-Id: I4606cefc9943c0a1a3a0db0c496dcce5c468407f
    Signed-off-by: Juergen Leopold <email address hidden>

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

Other bug subscribers

Remote bug watches

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