Пример #1
0
def master_state_relation_changed():
    if not relation_get('identity'):
        juju_log('Relationship with slave-state not yet complete')
        return
    process_clustered_data()
    state = relation_get('state')
    if check_all_clustered_nodes(state):
        if state == 'install':
            status_set('maintenance', 'Installing grid')
            if install_grid():
                install_root_scripts()
                send_notification("master-state", "cluster")
        elif state == 'clustered':
            if install_db():
                status_set('maintenance', 'Installing Database')
                install_db_root_scripts()
                send_notification("master-state", "database")
        elif state == 'final':
                send_notification("master-state", "final")
                set_oracle_env()
                create_db()
                configure_database()
                for rid in relation_ids('oracle'):
                    oracle_relation_changed(relation_id=rid)
                juju_log("Oracle Rac 12C installation is succeeded on master")
                status_set('active', 'Unit is ready')
Пример #2
0
def master_state_relation_changed():
    if not relation_get('identity'):
        juju_log('Relationship with slave-state not yet complete')
        return
    process_clustered_data()
    state = relation_get('state')
    if check_all_clustered_nodes(state):
        if state == 'install':
            status_set('maintenance', 'Installing grid')
            if install_grid():
                install_root_scripts()
                send_notification("master-state", "cluster")
        elif state == 'clustered':
            if install_db():
                status_set('maintenance', 'Installing Database')
                install_db_root_scripts()
                send_notification("master-state", "database")
        elif state == 'final':
            send_notification("master-state", "final")
            set_oracle_env()
            create_db()
            configure_database()
            for rid in relation_ids('oracle'):
                oracle_relation_changed(relation_id=rid)
            juju_log("Oracle Rac 12C installation is succeeded on master")
            status_set('active', 'Unit is ready')
Пример #3
0
def start():
    if not config('slave-units-number'):
        status_set('maintenance', 'Performing Oracle standalone Installation')
        download_cplane_packages()
        copy_oracle_package()

        modify_oracle_db_response_file()
        if install_db():
            install_db_root_scripts()
            set_oracle_env()
            create_db()
            juju_log('Database is created and the listerner is started')
            status_set('active', 'Unit is ready')
Пример #4
0
def start():
    if not config('slave-units-number'):
        status_set('maintenance', 'Performing Oracle standalone Installation')
        download_cplane_packages()
        copy_oracle_package()

        modify_oracle_db_response_file()
        if install_db():
            install_db_root_scripts()
            set_oracle_env()
            create_db()
            configure_database()
            juju_log('Database is created and the listerner is started')
            status_set('active', 'Unit is ready')
Пример #5
0
def slave_state_relation_changed():
    if not relation_get('identity'):
        juju_log('Relationship with master-state not yet complete')
        return
    if relation_get('state') == 'cluster':
        status_set('maintenance', 'Installing Root scripts')
        install_root_scripts()
        send_notification("slave-state", "clustered")
    if relation_get('state') == 'database':
        status_set('maintenance', 'Installing DB scripts')
        install_db_root_scripts()
        send_notification("slave-state", "final")
    if relation_get('state') == 'final':
        juju_log("Oracle Rac 12C installation is succeeded on slave")
        status_set('active', 'Unit is ready')
Пример #6
0
def slave_state_relation_changed():
    if not relation_get('identity'):
        juju_log('Relationship with master-state not yet complete')
        return
    if relation_get('state') == 'cluster':
        status_set('maintenance', 'Installing Root scripts')
        install_root_scripts()
        send_notification("slave-state", "clustered")
    if relation_get('state') == 'database':
        status_set('maintenance', 'Installing DB scripts')
        install_db_root_scripts()
        send_notification("slave-state", "final")
    if relation_get('state') == 'final':
        juju_log("Oracle Rac 12C installation is succeeded on slave")
        status_set('active', 'Unit is ready')
Пример #7
0
    def test_install_db_root_scripts(self, m_change_cluster_state, m_system):
        hostname = socket.gethostname()
        cplane_utils.install_db_root_scripts()
        m_change_cluster_state.assert_called_with(hostname, "final")
        m_system.assert_called_with("/u01/app/oracle/product/12.1.0.2/\
db_1/root.sh")
    def test_install_db_root_scripts(self, m_change_cluster_state, m_system):
        hostname = socket.gethostname()
        cplane_utils.install_db_root_scripts()
        m_change_cluster_state.assert_called_with(hostname, "final")
        m_system.assert_called_with("/u01/app/oracle/product/12.1.0.2/\
db_1/root.sh")