-
Notifications
You must be signed in to change notification settings - Fork 68
Error when switching to another organization #76
Description
What API call you use?
Provide a small example to reproduce the bug.
grafana_api = GrafanaFace(auth=(config["grafana_user"],config["grafana_pass"]),host=config["grafana_url"])
print(grafana_api.organizations.list_organization())
print(grafana_api.organization.get_current_organization())
grafana_api.organizations.switch_organization(organization_id=15)
The first two queries work fine, the last one returns a JSON error.
What is the actual output?
Copy or describe the actual result.
Traceback (most recent call last):
File "provision_api.py", line 19, in
grafana_api.organizations.switch_organization(organization_id=15)
File "/home/yentel/.local/lib/python3.7/site-packages/grafana_api/api/organization.py", line 132, in switch_organization
r = self.api.POST(switch_user_organization)
File "/home/yentel/.local/lib/python3.7/site-packages/grafana_api/grafana_api.py", line 136, in __request_runnner
return r.json()
File "/usr/lib/python3/dist-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3/dist-packages/simplejson/init.py", line 518, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
What is the expected output?
Something without an error that tells me I've switched to organization with id 15? :-)