ESGF / esgf-installer

ESGF P2P Node Installer
https://esgf.llnl.gov/
Other
20 stars 21 forks source link

Replaced subprocess with Plumbum (via call_binary function) in base module #517

Closed William-Hill closed 6 years ago

William-Hill commented 6 years ago

Using Plumbum for better exception handling and cleaner code

nathanlcarlson commented 6 years ago

@William-Hill One thing to note is that yum will actually do this whole block of code:

#Create system account (postgres) if it doesn't exist
    ########
    # Create the system account for postgress to run as.
    ########
    pg_sys_acct_homedir = psql_path
    if not check_for_postgres_sys_acct():
        # NOTE: "useradd/groupadd" are a RedHat/CentOS thing... to make this cross distro compatible clean this up.
        create_postgres_group()
        set_pg_sys_account_password()
        create_postgres_system_user(pg_sys_acct_homedir)

    else:
        postgress_user_shell = get_postgres_user_shell()
        if postgress_user_shell != "/bin/bash":
            set_postgres_user_shell()
    change_pg_install_dir_ownership()

So, we can keep it around because we are testing other things, or we could remove it and I am nearly certain nothing bad will happen.

nathanlcarlson commented 6 years ago

So, we can keep it around because we are testing other things, or we could remove it and I am nearly certain nothing bad will happen.

Remove it, and the functions being called.

nathanlcarlson commented 6 years ago

Well yum doesn't set_pg_sys_account_password but that is done earlier in the installer, in the questionnaire to be specific.

William-Hill commented 6 years ago

Good point, I'll remove it and test it out