2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-24 23:48:24 +00:00

Merge pull request #314 from shreyasp/minor-fixes

[Minor] Store mysql and admin passwords in passwords.txt and show success message after completion of the script
This commit is contained in:
Nabin Hait 2016-09-22 18:03:54 +05:30 committed by GitHub
commit 81dbfa9ff2

View File

@ -135,7 +135,7 @@ def get_distribution_info():
elif platform.system() == "Darwin":
current_dist = platform.mac_ver()
return "macos", current_dist[0].rsplit('.', 1)[0]
def install_python27():
version = (sys.version_info[0], sys.version_info[1])
@ -256,11 +256,18 @@ def get_passwords(ignore_prompt=False):
else:
mysql_root_password = admin_password = 'travis'
return {
passwords = {
'mysql_root_password': mysql_root_password,
'admin_password': admin_password
}
if not ignore_prompt:
passwords_file_path = os.path.join(os.path.expanduser('~'), 'passwords.txt')
with open(passwords_file_path, 'w') as f:
json.dump(passwords, f, indent=1)
return passwords
def get_extra_vars_json(extra_args):
# We need to pass production as extra_vars to the playbook to execute conditionals in the
# playbook. Extra variables can passed as json or key=value pair. Here, we will use JSON.
@ -340,3 +347,10 @@ if __name__ == '__main__':
args = parse_commandline_args()
install_bench(args)
print '''
Frappe/ERPNext has been successfully installed on your machine.
Please find mysql root password and admin password in "passwords.txt" in your root directory,
you can remove the file after making note of the passwords.
'''