尝试使用 python 结构脚本添加用户。
uid = prompt("Enter username:")
eid = prompt("Enter user's email address:")
password = generate_passwd()
run('adduser -g vpn -c %s %s') % (eid, uid)
run("echo -e '%s\n' | passwd %s") % (password, uid)
print (password)
错误:
File "/tmp/hardway/fabfile.py", line 56, in addvpnuser
run('adduser -g vpn -c %s %s') % (eid, uid)
TypeError: not all arguments converted during string formatting
知道我做错了什么。提前致谢。