vmware-archive / pyvcloud

Python SDK for VMware vCloud Director
https://vmware.github.io/pyvcloud
Other
170 stars 190 forks source link

Gateway get configuration error #539

Open pimuzzo opened 5 years ago

pimuzzo commented 5 years ago
gateway_resource = vdc.get_gateway('EDGE-XXDH-CMP-Pub-01')

gateway_obj = Gateway(client, 'EDGE-XXDH-CMP-Pub-01', href=gateway_resource.get('href'))
gateway_obj.get_resource().Configuration.GatewayInterfaces.GatewayInterface

gateway = Gateway(client, resource=gateway_resource)
gateway.get_resource().Configuration.GatewayInterfaces.GatewayInterface

The second block is not working gateway.get_resource().Configuration.GatewayInterfaces.GatewayInterface

throws:

Traceback (most recent call last):
  File "/home/pimo/cloudesire/deployer-pyvcloud/deployer_pyvcloud/exception_handlers/__init__.py", line 21, in capture_generic
    raise ex
  File "falcon/api.py", line 269, in falcon.api.API.__call__
  File "/home/pimo/cloudesire/deployer-pyvcloud/deployer_pyvcloud/controllers/instance_resource.py", line 22, in on_get
    resp.media = asdict(InstanceService.retrieve(resource_name))
  File "/home/pimo/cloudesire/deployer-pyvcloud/deployer_pyvcloud/services/instance_service.py", line 75, in retrieve
    gateway.get_resource().Configuration.GatewayInterfaces.GatewayInterface
  File "src/lxml/objectify.pyx", line 231, in lxml.objectify.ObjectifiedElement.__getattr__
  File "src/lxml/objectify.pyx", line 451, in lxml.objectify._lookupChildOrRaise
AttributeError: no such child: {http://www.vmware.com/vcloud/v1.5}Configuration

I expect that by instancing the same object with different parameters the behavior is the same

pandeys commented 5 years ago

We are looking into it.