Skip to content

v5.2.0

Latest

Choose a tag to compare

@resmo resmo released this 20 Oct 16:28
· 2 commits to master since this release

Highlights

  • The async client reuses connections. Use async with AIOCloudStack(...) as cs: and every call shares one HTTP session. You can also pass an existing aiohttp.ClientSession as session=, which is left open. The async client now supports trace, retry and json=False, like the sync client.
  • The sync client keeps its connections alive. It used to close its session after every request.
  • Retries back off. Retries of list and queryAsync calls wait retry_backoff seconds (default 0.5) before the first attempt. The wait doubles on each further attempt, up to 30 seconds.
  • Type hints. The package now ships type hints and a py.typed marker.

Fixes

  • Boolean settings read from the environment were not converted, so CLOUDSTACK_TRACE=false and CLOUDSTACK_DANGEROUS_NO_TLS_VERIFY=false were treated as true.
  • fetch_list=True no longer loops forever on an empty page.
  • Lists of numbers, floats and booleans are now accepted as parameters. Sets are sent in a stable order.
  • A response without exactly one top-level key now raises CloudStackException instead of ValueError.
  • python -m cs now exits with a non-zero status on errors. Error messages are no longer printed twice.
  • The CLI only strips one pair of matching quotes around a value, so name=it's stays intact.
  • hasattr(), copy and pickle no longer treat private attribute names as API commands.
  • The async client sends the call's headers while polling a job, and no longer fails when a response has no Content-Type header.
  • job_timeout is measured with a monotonic clock, so system clock changes don't affect it.

New settings

  • retry_backoff / CLOUDSTACK_RETRY_BACKOFF
  • job_timeout / CLOUDSTACK_JOB_TIMEOUT can now be set in the config file and the environment. Before, it could only be passed in Python.

Behavior changes

  • Booleans are sent as true/false instead of True/False. CloudStack accepts both.
  • Headers passed to a single call now override the client's headers for the same name.
  • Retries wait before resending. Set retry_backoff=0 to retry immediately as before.
  • tzdata is no longer a dependency.

What's Changed

Full Changelog: v5.1.0...v5.2.0