We use string formatter to contruct serialization result.
The template used is str(byte) in python2 even though when the val is
unicode.
This is fine when val only contains ASCII chars since python can encode
them to str implicitly using ASCII encoding. But when the val is
non-ASCII unicodes,
the conversion fails. Fix it by using a unicode template to avoid the
conversion.
According to the code, guest os not running state is : "notRunning"
```python
CreateEnumType("vim.vm.GuestInfo.GuestState", "VirtualMachineGuestState", "vim.version.version1", ["running", "shuttingDown", "resetting", "standby", "notRunning", "unknown"])
```
This prevents maximum recursion depth errors when referencing _HTTPSConnection.connect. The custom __getattr__ was a leftover from 21a5d52e6a which removed the self._wrapped attribute.
Revert HTTPSConnectionWrapper back to _HTTPSConnection to fix thumbprint verification.
Create custom_patches to support custom _HTTPSConnection. So tests should use below annotation:
@tests.VCRTestBase.my_vcr.use_cassette...
VM folders may contain vApps. If a vApp is detected, print its
child VMs.
A vApp may contain child vApps too, but since this is a rare
usecase, nested vApps and their child VMs are ignored.
Signed-off-by: Martin Mosegaard Amdisen <martin.amdisen@praqma.com>
Some type, in this case 'Task' is not defined in the specified namespace(urn:nfc). In such case, the deserializer will have to guess the namespace by interate namesapce in the _wsdlTypeMapNSs. 'Task' exists in multiple namespaces. In python2, the order in the map is fixed and vim25 is always tried first, but in python3 the order of the set is random. If wrong namespace is returned, the xml parser will fail later on.
VC is returning some internal managed method in 6.0. Looks like this issue
will be resolved in 6.5 server types as it will be public in 6.5. To tempoarily
workaound this issue, returning a dummy method and dummy obj instead of throwing
exception when client side can't understand the returned managed method.
pyvmomi objects can be resolved by the vmodl name, e.g. "vim.vm.RelocateSpec"
or by the wsdl name, e.g. "vim.VirtualMachineRelocateSpec".
The wsdl name resolution uses "vim" as a hard-coded name, and doesn't
resolve more wsdl namespaces like "sms" and "pbm"
SoapStubAdapter supports adding soap headers using GetRequestContext, but
the request context is thread-local. Adding support for a per-instance request context.
This is needed e.g. for vSphere SMS API, where only the SMS SoapAdapter needs
the additional headers.