Created
July 2, 2013 19:47
-
-
Save hub-cap/5912493 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def _write_mycnf(self, admin_password, config_location, config_contents): | |
| """ | |
| Install the set of mysql my.cnf templates. | |
| Update the os_admin user and password to the my.cnf | |
| file for direct login from localhost | |
| """ | |
| LOG.info(_("Writing my.cnf templates.")) | |
| if admin_password is None: | |
| admin_password = get_auth_password() | |
| tempfile = tempfile.NamedTemporaryFile() | |
| with tempfile as t: | |
| t.write(config_contents) | |
| self._write_temp_mycnf_with_admin_account(config_location, | |
| tempfile.name, | |
| admin_password) | |
| utils.execute_with_timeout("sudo", "mv", tempfile.name, | |
| config_location) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment