I ran into an issue in a review about moving environment resolution from client to server [1]. It revolves around clients being able to access older versions of servers (that's a pretty simplistic description; see [2] for the spec).

Before the holiday, Steve Hardy and I were talking about the complications involved. In my case, there's no good way to differentiate an older server from a legitimate error.

Since the API isn't versioned to the extent that we can leverage that value, I was looking into using the template versions call. Something along the lines of:

  supported_versions = hc.template_versions.list()
version_nums = [i.to_dict()['version'].split('.')[1] for i in supported_versions]
  mitaka_or_newer = [i for i in version_nums if i >= '2016-04-08']

Yes, I'm planning on cleaning that up before submitting it :)

What I'm wondering is if I should make this into some sort of generalized utility method in the client, under the assumption that we'll need this sort of check in the future for the same backward compatibility requirements.

So a few questions:

1. Does anyone strongly disagree to checking supported template versions as a way of determining the specifics of the server API.

2. Does anything like this already exist that I can use?

3. If not, any suggestions on where I should put it? I see a heat.common.utils module but I'm not sure if there is a convention against that module (or common in general) making live server calls.

Thanks :D

[1] https://review.openstack.org/#/c/239504/
[2] https://review.openstack.org/#/c/226157/

OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe

Reply via email to