the clients.has_client() function returns misleading results

Bug #1462555 reported by Miguel Grinberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Miguel Grinberg

Bug Description

While working on moving the mistral and manila clients from contrib to the main source tree, I noticed that the clients.has_client() function does not really check for the existence of the client, it just looks for a ClientPlugin instance that wraps it.

With this model it is not possible to support clients and resources that are optional, in the sense that they only make themselves available when their dependencies are found in the system. The correct behavior for has_client() and the client() and client_plugin() methods of class Client is to only report those clients that are installed.

Changed in heat:
assignee: nobody → Miguel Grinberg (miguelgrinberg)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
status: New → In Progress
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

This wasn't the original intention of has_client, but this is a reasonable enhancement

Changed in heat:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/188979
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=d3fee2141cc816b1ae31f2111624b9dd9fa65cd7
Submitter: Jenkins
Branch: master

commit d3fee2141cc816b1ae31f2111624b9dd9fa65cd7
Author: Miguel Grinberg <email address hidden>
Date: Fri Jun 5 17:19:04 2015 -0700

    Give client plugins the chance to not register

    This change improves the client plugin registration process by giving
    each plugin a is_available() class method that can prevent the plugin's
    registration when there are missing dependencies.

    Change-Id: Ief965d033f02f795d5be9beccae5e4b0b96d10b1
    Closes-Bug: #1462555

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-1 → 5.0.0
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.