Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different environment variable between server and fabric2.4 #1987

Open
YesOhh opened this issue Jun 26, 2019 · 1 comment
Open

Different environment variable between server and fabric2.4 #1987

YesOhh opened this issue Jun 26, 2019 · 1 comment

Comments

@YesOhh
Copy link

YesOhh commented Jun 26, 2019

When i input 'locale' in a server, i get the following result:
LANG=zh_CN.UTF-8
......
......

But when i use fabric like this:

    from fabric import Connection, Config
    config = Config(overrides={'sudo':{'password': 'xxxxxxxx'}})
    c = Connection(f'xxxx@xx.xx.xx.xx', connect_kwargs={'password':'xxxxxxxx'}, config=config)
    c.run('locale')

Result like this:
LANG=en_US
......
......

How can i change the fabric's environment variable?
I can't find a method in the document. Anyone can help me?
Thank You!

@honglei
Copy link

honglei commented Apr 22, 2020

Try fabric2, I got corrent result:

LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants