Exemplo n.º 1
0
def leader_settings_changed():
    if not is_leader() and is_leader_ready() and is_oracle_relation_joined():
        set_oracle_host()
        set_data_source()
        if check_jboss_service() is True:
            pass
        else:
            start_services('create-db')
Exemplo n.º 2
0
def leader_settings_changed():
    if not is_leader() and is_leader_ready() and is_oracle_relation_joined():
        set_oracle_host()
        set_data_source()
        if check_jboss_service() is True:
            pass
        else:
            start_services('create-db')
Exemplo n.º 3
0
def start():
    if config('jboss-db-on-host'):
        oracle_host = set_oracle_host()
        if oracle_host:
            set_oracle_env()
            prepare_database()
            start_services('create-db')
Exemplo n.º 4
0
def start():
    if config('jboss-db-on-host'):
        oracle_host = set_oracle_host()
        if oracle_host:
            set_oracle_env()
            configure_database()
            prepare_database()
            start_services('create-db')
Exemplo n.º 5
0
def oracle_relation_changed():
    oracle_host = set_oracle_host()
    if oracle_host:
        create_ketstone_user()
        configs.write_all()
        restart_service()
        configure_keystone()
        create_domain()
        send_active_notification()
Exemplo n.º 6
0
def oracle_relation_changed():
    if config('jboss-db-on-host') is False:
        oracle_host = set_oracle_host()
        if oracle_host:
            if check_jboss_service() is False:
                cplane_installer()
                if config('intall-reboot-scripts') == 'y':
                    install_reboot_scripts()
                prepare_database()
                start_services('create-db')
Exemplo n.º 7
0
def start():
    if config('db-on-host'):
        oracle_host = set_oracle_host()
        if oracle_host:
            create_ketstone_user()
            configs.write_all()
            restart_service()
            configure_keystone()
            create_domain()
            send_active_notification()
Exemplo n.º 8
0
def oracle_relation_changed():
    if config('jboss-db-on-host') is False:
        oracle_host = set_oracle_host()
        if oracle_host:
            if check_jboss_service() is False:
                cplane_installer()
                if config('intall-reboot-scripts') == 'y':
                    install_reboot_scripts()
                if is_leader():
                    configure_database()
                    prepare_database()
                start_services('create-db')
Exemplo n.º 9
0
def drop_cplane_data(args):
    connect_string = ''
    if config('jboss-db-on-host'):
        set_oracle_env()
        connect_string = 'sys/' + config('oracle-password') + \
                         '@localhost/XE as sysdba'
    else:
        configure_oracle_client()
        oracle_host = set_oracle_host()
        if oracle_host:
            host = cplane_utils.ORACLE_HOST + '/'
            connect_string = 'sys/' + cplane_utils.DB_PASSWORD \
                             + '@' + host + cplane_utils.DB_SERVICE + ' as' \
                             + ' sysdba'
        else:
            action_set({'result-map.message': "No Oracle Host found"})

    log("Dropping user and tables spaces from DB")
    log(connect_string)
    res = execute_sql_command(connect_string, "drop user admin cascade;")
    action_set({'result-map.message': res})
    res = execute_sql_command(
        connect_string, "drop tablespace cp_tabs \
including contents and datafiles cascade constraints;")
    action_set({'result-map.message': res})
    res = execute_sql_command(
        connect_string, "drop tablespace cp_tabm \
including contents and datafiles cascade constraints;")
    action_set({'result-map.message': res})
    res = execute_sql_command(
        connect_string, "drop tablespace cp_tabl \
including contents and datafiles cascade constraints;")
    action_set({'result-map.message': res})
    res = execute_sql_command(
        connect_string, "drop tablespace cp_inds \
including contents and datafiles cascade constraints;")
    action_set({'result-map.message': res})
    res = execute_sql_command(
        connect_string, "drop tablespace cp_indm \
including contents and datafiles cascade constraints;")
    action_set({'result-map.message': res})
    res = execute_sql_command(
        connect_string, "drop tablespace cp_indl \
including contents and datafiles cascade constraints;")
    action_set({'result-map.message': res})
Exemplo n.º 10
0
def start():
    if config('db-on-host'):
        oracle_host = set_oracle_host()
        if oracle_host:
            create_ketstone_user()
            configs.write_all()
Exemplo n.º 11
0
def oracle_relation_changed():
    oracle_host = set_oracle_host()
    if oracle_host:
        create_neutron_user()
        configs.write_all()
        post_oracle_keystone_calls()