<s> from sahara . plugins . cdh import db_helper as dh <EOL> from sahara . utils import files <EOL> def get_hive_db_password ( cluster ) : <EOL> return dh . get_password_from_db ( cluster , dh . HIVE_DB_PASSWORD ) <EOL> def get_sentry_db_password ( cluster ) : <EOL> return dh . get_password_from_db ( cluster , dh . SENTRY_DB_PASSWORD ) <EOL> def create_hive_database ( cluster , remote ) : <EOL> db_password = get_hive_db_password ( cluster ) <EOL> create_db_script = files . get_file_text ( <EOL> '<STR_LIT>' ) <EOL> create_db_script = create_db_script % db_password <EOL> dh . remote_execute_db_script ( remote , create_db_script ) <EOL> def create_sentry_database ( cluster , remote ) : <EOL> db_password = get_sentry_db_password ( cluster ) <EOL> create_db_script = files . get_file_text ( <EOL> '<STR_LIT>' ) <EOL> create_db_script = create_db_script % db_password <EOL> dh . remote_execute_db_script ( remote , create_db_script ) </s>
