properly expire password upon user creation for template

This commit is contained in:
Jordan Rodgers 2018-02-12 13:15:07 -05:00
parent d7541fe356
commit e0c564269f

View file

@ -152,6 +152,9 @@ def setup_template(template_id, name, user, password, cores, memory):
stdin, stdout, stderr = client.exec_command(
"echo '{}' | passwd '{}' --stdin".format(password, user))
exit_status = stdout.channel.recv_exit_status()
stdin, stdout, stderr = client.exec_command(
"passwd -e '{}'".format(user))
exit_status = stdout.channel.recv_exit_status()
stdin, stdout, stderr = client.exec_command(
"echo '{} ALL=(ALL:ALL) ALL' | sudo EDITOR='tee -a' visudo".format(
user))