python - 3 arguments for 3 tokens but not enough arguments error -
If I make a user named Talbot on an Ubuntu server, then I manually own the directory of this user's directory. I can try to do the same thing in the last line of this foundry dragon.
However,
sudo ("chown% s:% s -R / home /% S "% new_user, new_user, new_user" is giving me this error sudo ("chown% s:% s -R / home /% s"% new_user, new_user, new_user) Type error: There is not enough logic for the format string
Can you explain why this error is happening?
def user_edid (new_user, passwood = fail): "" add new user "(if 's' passwd = generated_passwd ()) is not sudo (" useradd -p $ (' Echo ') (' running ',' stdout ',' stderr '), warn_only = true): # if_host_up (env.host)% s' openssl passwd-1 -stidine)% s "% (passwd , New_user) failed: run ('echo' {user} ALL = (ALL: ALL) ">> / etc / sudoers'format (user = new_user)) if env.host == '107 XX.XX.XXX ': Sudo ("MKDIR / Home /% s"% new_user, warn_only = true) Sudo ("thick% S:% s -R / home /% s"% new_user, new_user, new_user)
All your logic for your format string Needing to be installed in the eingal tube, therefore, instead of
pseudo ("% chown% s:% s -R / home /% s"% new_user, new_user, new_user) you need the Sudo ("chown% s:% s -R / home /% s"% (new_user, new_user, new_user))
Comments
Post a Comment