Skip to main content

OpenStack microversion header parser

Project description

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_headers=['x-openstack-nova-api-version'])

It processes microversion headers with the standard form:

OpenStack-API-Version: compute 2.1

If provided with a legacy_headers argument, this is treated as a list of headers to check for microversions. Some examples of headers include:

OpenStack-telemetry-api-version: 2.1
OpenStack-nova-api-version: 2.1
X-OpenStack-nova-api-version: 2.1

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

microversion_parse-0.1.4.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

microversion_parse-0.1.4-py2-none-any.whl (7.6 kB view details)

Uploaded Python 2

File details

Details for the file microversion_parse-0.1.4.tar.gz.

File metadata

File hashes

Hashes for microversion_parse-0.1.4.tar.gz
Algorithm Hash digest
SHA256 040558958b5a9db618b55c326c5cb15a59e21ae7a2754c7017ffc85015b2db7c
MD5 8d7f87025750d6962834c9a7128770d0
BLAKE2b-256 580146079587391734d6ceb8ba7956c9a8e766c4e31d55b953dd872db703d182

See more details on using hashes here.

File details

Details for the file microversion_parse-0.1.4-py2-none-any.whl.

File metadata

File hashes

Hashes for microversion_parse-0.1.4-py2-none-any.whl
Algorithm Hash digest
SHA256 1466c5a91870792f206a923c2c26b6bc5b132a291e76efb287e7e6f1dd4edbd9
MD5 b1ef611c8af4438894cf27753c7c28e1
BLAKE2b-256 cdc407276145a0a990c4918cf1de71a87937de2b1fa9d34a2f4a6ee3fdefcef0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page