fix(user manage and connect first login)

When delete a user, but didn't delete the user sysuser key. When create
a user with same username, error occur.

When user login tty, and type a num first, it will search a host, but
login the asset with the id.

fixed
This commit is contained in:
ibuler
2016-04-05 22:34:37 +08:00
parent d20fecadac
commit 1f09a40c77
3 changed files with 4 additions and 2 deletions

View File

@@ -181,6 +181,8 @@ def server_del_user(username):
删除系统上的某用户
"""
bash('userdel -r -f %s' % username)
print('rm -f %s/%s_*.pem' % (os.path.join(KEY_DIR, 'user'), username))
bash('rm -f %s/%s_*.pem' % (os.path.join(KEY_DIR, 'user'), username))
def get_display_msg(user, password='', ssh_key_pwd='', send_mail_need=False):