Cfapi contains various bugs (AttributeError/NameError)

Bug #1661065 reported by Felipe Monteiro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
Undecided
Felipe Monteiro

Bug Description

Currently, murano/cfapi/cfapi.py contains various bugs.

1) In _get_muranoclient, CONF.cfapi is accessed, which throws an AttributeError, since 'cfapi' is not a valid group in murano/common/config.py. The 'cfapi' should be replaced with 'engine'.

2) In get_last_operation, if m_environment.status is not in ['ready', 'pending', 'deleting', 'deploying', 'deploy failure', 'delete failure'], then resp is returned before being defined; this results in a NameError being thrown.

In addition, the first LOG.warning statement in get_late_operation is formatted like this:
    LOG.warning(_LW('Requested service for instance {} is not found'))
However, the instance is not specified; this appears to be unintentional. This line should be changed to:
    LOG.warning(_LW('Requested service for instance {0} is not found').format(instance_id))

Felipe Monteiro (fm577c)
Changed in murano:
assignee: nobody → Felipe Monteiro (fm577c)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (master)

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

Changed in murano:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/427860
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=1e9a625f9c3e050fd3478df5b066304cba4cda69
Submitter: Jenkins
Branch: master

commit 1e9a625f9c3e050fd3478df5b066304cba4cda69
Author: Felipe Monteiro <email address hidden>
Date: Wed Feb 1 13:41:46 2017 -0500

    Fixes various Cfapi bugs.

    Currently, murano.cfapi.cfapi throws 2 bugs, when certain
    branches are reached.

    1) An AttributeError is thrown by _get_muranoclient, because
       CONF.cfapi is accessed; however, cfapi is not a defined
       group in murano.common.conf. The group should instead be
       CONF.engine, where packages_service is located.

    2) A NameError can be thrown by get_last_operation, in the
       unlikely situation when m_environment.status is not contained
       in any of the cases enumerated in the if/elif branches;
       when this happens, 'resp' is returned without being defined,
       resulting in this error.

    3) Not a bug per se, but a LOG.warning statement is not formatted
       correctly in get_last_operation. It does not specify the
       instance_id in the error message.

    Change-Id: If91a0f8f700a9c0cda0ea85a1d37938f5ef8f98c
    Closes-Bug: #1661065

Changed in murano:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/murano 3.2.0

This issue was fixed in the openstack/murano 3.2.0 release.

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.