Skip to content

Authentication failure when using direct return value from create_vsphere_client #435

Description

@nikstuckenbrock

Describe the bug

Calling the synchronous vcenter api leads to different behaviors depending on if you assign the return value of create_vsphere_client before usage.

Calling it directly from the return value raises this excpetion:

LocalizableMessage(id='com.vmware.vapi.endpoint.method.authentication.required', default_message='Authentication required.', args=[], params=None, localized=None)], data : None, error_type : UNAUTHENTICATED} 

Reproduction steps

Failure

x = create_vsphere_client(
    server="",
    username="",
    password="",
    session="",
).vcenter.vm.list()

Works

x = create_vsphere_client(
    server="",
    username="",
    password="",
    session="",
)
x.vcenter.vm.list()

Expected behavior

Both version work without errors.

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions