gpt4 book ai didi

python - Getpass 错误

转载 作者:行者123 更新时间:2023-11-28 16:47:01 24 4
gpt4 key购买 nike

以下结构脚本是开源的,我需要使用它,不幸的是我不熟悉这些东西。结构文件以:

from fabric.api import *
import time

env.user = 'aegir'
env.shell = '/bin/bash -c'

# Download and import a platform using Drush Make
def build_platform(site, profile, webserver, dbserver, makefile, build):
  print "===> Building the platform..."
  run("drush make %s /var/aegir/platforms/%s" % (makefile, build))

当 Git 推送触发新构建时,结构文件由 Jenkins 服务器运行。执行此文件时,第一个远程操作(最后一行)会导致以下错误。

/usr/lib/python2.6/getpass.py:83: GetPassWarning: Can not control echo on the terminal.
passwd = fallback_getpass(prompt, stream)
Warning: Password input may be echoed.
Password for aegir@o1.sub.aegir.local: ===> Building the platform...
[o1.sub.aegir.local] run: drush make https://raw.github.com/mig5/builds/master/mig5_platform.build /var/aegir/platforms/20121011010955
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/fabric/main.py", line 435, in main
commands[name](*args, **kwargs)
File "/usr/local/bin/fabfile.py", line 11, in build_platform
run("drush make %s /var/aegir/platforms/%s" % (makefile, build))
File "/usr/lib/pymodules/python2.6/fabric/network.py", line 390, in host_prompting_wrapper
return func(*args, **kwargs)
File "/usr/lib/pymodules/python2.6/fabric/operations.py", line 414, in run
channel = connections[env.host_string]._transport.open_session()
File "/usr/lib/pymodules/python2.6/fabric/network.py", line 65, in __getitem__
self[real_key] = connect(user, host, port)
File "/usr/lib/pymodules/python2.6/fabric/network.py", line 219, in connect
password = prompt_for_password(password, text)
File "/usr/lib/pymodules/python2.6/fabric/network.py", line 279, in prompt_for_password
new_password = getpass.getpass(password_prompt)
File "/usr/lib/python2.6/getpass.py", line 83, in unix_getpass
passwd = fallback_getpass(prompt, stream)
File "/usr/lib/python2.6/getpass.py", line 118, in fallback_getpass
return _raw_input(prompt, stream)
File "/usr/lib/python2.6/getpass.py", line 135, in _raw_input
raise EOFError
EOFError
Build step 'Execute shell' marked build as failure
Finished: FAILURE

我是否必须为 aegir 用户指定密码?我试图在 env.user = 'aegir',但这并没有解决任何问题。

最佳答案

Ssh 服务禁止没有密码的用户进行远程访问。您可以在机器上和 fabfile 中为 aegir 用户设置密码。

关于python - Getpass 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12872495/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com