Run the attached script as follows:
./maas -k $USER_API_KEY http://$REGION_IP:5240/MAAS/api/2.0/machines/
Most of the time you'll get
ERROR: status code - 500
expected string or bytes-like object
On line 22 uncomment 'headers["Accept"] = "application/json"' and now the call works.
Run the attached script as follows:
./maas -k $USER_API_KEY http:// $REGION_ IP:5240/ MAAS/api/ 2.0/machines/
Most of the time you'll get
ERROR: status code - 500
expected string or bytes-like object
On line 22 uncomment 'headers["Accept"] = "application/json"' and now the call works.