libcloud icon indicating copy to clipboard operation
libcloud copied to clipboard

Azure arm ex_customdata causes json error

Open foospidy opened this issue 2 years ago • 1 comments

Summary

For Azure arm, create_node, the ex_customedata parameter is not properly decoded after base64 encoding. This results in invalid json. When the driver creates the request the error Object of type bytes is not JSON serializable occurs.

Detailed Information

libcloud 3.7.0 Python 3.10.11 Linux ubuntu/debian

To replicate, call azure arm driver.create_node with parameter: ex_customdata=str.encode(deployment_script),

suggested fix: https://github.com/foospidy/libcloud/commit/20df1c327da71d364132ff8b6e8152dd4554aaad

foospidy avatar Apr 15 '23 23:04 foospidy

@foospidy Thanks for reporting this.

Please feel free to open a PR with a suggested fix (+ ideally a unit test). We've had similar issues in the code in the past, most were related to Python 2 -> Python 3 migration.

Kami avatar Aug 02 '23 12:08 Kami