exoscale / cs

A simple, yet powerful CloudStack API client for python and the command-line.
BSD 3-Clause "New" or "Revised" License
88 stars 36 forks source link

Fix exception when fetch_results=True and trace=True #83

Closed phsm closed 5 years ago

phsm commented 5 years ago

When you set up trace=True and try to launch async call with fetch_result, you'll get the following exception in _jobresult() method: AttributeError: 'str' object has no attribute 'items'

This is caused by overwriting "headers" variable in _request() method when tracing is enabled. As a result, headers are passed to _jobresult() as a string. The solution is to rename headers variable in self.trace ifblock to something else.

greut commented 5 years ago

Good catch!