49b44934b973d38737a6b2c0fb9a0fc17e74a4a8

See README.rst for details. The basic gist is that a get_version method is provided. It takes a dict or list of headers and returned a version for a service_type if it can find it.
microversion_parse =================
A simple parser for OpenStack microversion headers:
import microversion_parse
# headers is a dict of headers with folded (comma-separated
# values) or a list of header, value tuples
version = microversion_parse.get_version(
headers, service_type='compute', legacy_type='nova')
It processes microversion headers with the standard form:
OpenStack-API-Version: compute 2.1
It also deals with several older formats, depending on the values of the service_type and legacy_type arguments:
OpenStack-compute-api-version: 2.1
OpenStack-nova-api-version: 2.1
X-OpenStack-nova-api-version: 2.1
Note
The X prefixed version does not currently parse for service type named headers, only project named headers.
If a version string cannot be found None
will be
returned. If the input is incorrect usual Python exceptions (ValueError,
TypeError) are allowed to raise to the caller.
Description
Languages
Python
97.2%
Makefile
2.8%