[openstack-dev] [heat] Shared code between server and client

Steve Baker sbaker at redhat.com
Thu Oct 22 23:13:00 UTC 2015

On 23/10/15 08:49, Jay Dobies wrote:
> I'm working on moving the functionality for merging environments from 
> the client into the server [1]. I've only superficially looked at 
> template_utils.py (in heatclient) but I'm guessing there is stuff in 
> there I will want to use server-side.
> The server has a requirement on heatclient, but I'm not sure what the 
> convention is for using code in it. Can I directly call into a module 
> in heatclient/common from the server or is the client dependency only 
> intended to be used through the client-facing APIs?
> [1] https://blueprints.launchpad.net/heat/+spec/multi-environments
heat server already depends on heatclient, which was done so that some 
template parsing could live in heatclient and be shared by both (this 
isn't finished, and anyone who wants to pick it up is welcome to)

So yes, this would be a valid case for heat calling heatclient functions.

As an aside, it would be preferable if heatclient can somehow discover 
that it is interacting with a multi-env aware REST API, and fallback to 
local merging as appropriate.

More information about the OpenStack-dev mailing list