pyvcloud icon indicating copy to clipboard operation
pyvcloud copied to clipboard

Can not get the organization list

Open thuvh opened this issue 3 years ago • 0 comments

Describe the bug

(venv) thuvh@hello:~/tmp$ python exporter.py 
Traceback (most recent call last):
  File "exporter.py", line 66, in <module>
    main()
  File "exporter.py", line 40, in main
    org_resources = client.get_org_list()
  File "/home/thuvh/tmp/venv/lib/python3.8/site-packages/pyvcloud/vcd/client.py", line 1630, in get_org_list
    org_resource = self.get_resource(org.get('href'))
  File "/home/thuvh/tmp/venv/lib/python3.8/site-packages/pyvcloud/vcd/client.py", line 1541, in get_resource
    return self._do_request(
  File "/home/thuvh/tmp/venv/lib/python3.8/site-packages/pyvcloud/vcd/client.py", line 1258, in _do_request
    self._response_code_to_exception(
  File "/home/thuvh/tmp/venv/lib/python3.8/site-packages/pyvcloud/vcd/client.py", line 1271, in _response_code_to_exception
    raise AccessForbiddenException(sc, request_id, objectify_response)
pyvcloud.vcd.exceptions.AccessForbiddenException: Status code: 403/ACCESS_TO_RESOURCE_IS_FORBIDDEN, [ uuid ] The VMware Cloud Director entity com.vmware.vcloud.entity.org:<uuid> does not exist. (request id: uuid)

I think sometimes, there are some data which is deleted from ui, but the entity is not deleted in the database

Reproduction steps

I'm not sure how can I reproduce this error

Expected behavior

I thin we can receive list of organization and skip the error

Additional context

python3.8
pyvcloud               23.0.3 
vcd-api-schemas-type   10.3.0.dev72
VMware Cloud Director version:
10.3.3.19610595

thuvh avatar May 26 '22 11:05 thuvh