Do not reset password of user-root accounts

Reset the password of the localhost root account used by Trove
for initial datastore configuration.
Leave the root accounts created by root-enable intact.

Change-Id: I02500996e098f4a63ebabaf79042eaf6af0f3c0a
Closes-Bug: 1549969
This commit is contained in:
Petr Malik 2016-02-25 15:35:07 -05:00
parent 35b5ac0646
commit 88686a2ee7

View File

@ -43,7 +43,8 @@ class MySQLRestoreMixin(object):
RESET_ROOT_MYSQL_COMMANDS = ("START TRANSACTION;",
"UPDATE `mysql`.`user` SET"
" `password`=PASSWORD('')"
" WHERE `user`='root';",
" WHERE `user`='root'"
" AND `host` = 'localhost';",
"FLUSH PRIVILEGES;",
"COMMIT;")
# This is a suffix MySQL appends to the file name given in
@ -127,6 +128,10 @@ class MySQLRestoreMixin(object):
"mysqld did not stop!"))
def reset_root_password(self):
"""Reset the password of the localhost root account used by Trove
for initial datastore configuration.
"""
with tempfile.NamedTemporaryFile() as init_file:
operating_system.chmod(init_file.name, FileMode.ADD_READ_ALL,
as_root=True)