Skip to content

Upstream pyVmomi doesn't allow for setting 'locale' in session connection #38402

Closed

Description

@UtahDave

Description of Issue/Question

When using the vmware salt-cloud driver it's not possible to specify the locale when making the connection to vmware. When connecting to an instance of vmware that's running with a non-english locale it causes parsing problems with salt-cloud

Setup

Install salt-cloud and configure it to talk to VMware running under a non-english locale

Steps to Reproduce Issue

Run any salt-cloud command under the above conditions

Versions Report

Salt 2016.3.3

A workaround for the moment is to make a small change to the pyVmomi connection login command to pass in the en locale.
In the pyVmomi 6.5 release modify the line found here in pyVim/connect.py: https://github.com/vmware/pyvmomi/blob/v6.5.0/pyVim/connect.py#L382

Change:

 x = content.sessionManager.Login(user, pwd, None)

to

 x = content.sessionManager.Login(user, pwd, 'en')

This issue is a placeholder until a proper fix can be made upstream.

Activity

  1. UtahDave commented on Dec 21, 2016

    @UtahDave
    ContributorAuthor

    ZD-977

  2. added
    bug
    severity-medium
    P4
    RIoT
    on Dec 22, 2016
  3. added this to the Approved milestone on Dec 22, 2016
  4. sebw commented on Mar 15, 2017

    @sebw
    Contributor

    This workaround works fine for salt-cloud VM creation (I use the salt runner cloud.create), but other things listing snapshots or resetting VM still break.

    # salt-cloud -f list_snapshots vmware -l trace
    [...]
    [ERROR   ] There was an error running the function: 'ascii' codec can't encode character u'\xe9' in position 9: ordinal not in range(128)
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/salt/cloud/cli.py", line 274, in run
        self.function_provider, self.function_name, kwargs
      File "/usr/lib/python2.7/site-packages/salt/cloud/__init__.py", line 1611, in do_function
        driver: self.clouds[fun](call='function')
      File "/usr/lib/python2.7/site-packages/salt/cloud/clouds/vmware.py", line 1898, in list_snapshots
        ret[vm["name"]] = _get_snapshots(vm["snapshot"].rootSnapshotList)
      File "/usr/lib/python2.7/site-packages/salt/cloud/clouds/vmware.py", line 1181, in _get_snapshots
        snapshot_path = "{0}/{1}".format(parent_snapshot_path, snapshot.name)
    UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 9: ordinal not in range(128)
    

    Would you have another workaround?

  5. stale commented on Sep 16, 2018

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

    If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4RIoTSalt-Cloudbugseverity-mediumstale

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions