Example #1
0
def upgrade_charm():
    download_cplane_installer()
    upgrade_type = get_upgrade_type()
    stop_jboss_service()
    if upgrade_type == 'clean-db':
        clean_create_db()
    cplane_installer()
    if config('intall-reboot-scripts') == 'y':
        install_reboot_scripts()
    start_services(upgrade_type)
def upgrade_charm():
    download_cplane_installer()
    upgrade_type = get_upgrade_type()
    stop_jboss_service()
    if upgrade_type == 'clean-db':
        if is_leader():
            leader_set({'status': "db_cleaned"})
            clean_create_db()
    cplane_installer()
    if config('intall-reboot-scripts') == 'y':
        install_reboot_scripts()
    start_services(upgrade_type)
    def test_clean_create_db(self, m_set_oracle_host, m_execute_sql_command,
                             m_system, m_chdir, m_set_oracle_env):
        cplane_utils.ORACLE_HOST = 'localhost'
        cplane_utils.clean_create_db()
#        m_set_oracle_env.assert_called_with()
        m_set_oracle_host.assert_called_with()
        m_system.assert_called_with('sh install.sh admin/admin@localhost/\
 2>&1 | tee install.log')
        m_execute_sql_command.assert_called_with('admin/admin@localhost/',
                                                 '@reinstall_plsql')
        m_system.assert_called_with('sh install.sh admin/admin@localhost/\
 2>&1 | tee install.log'.format(cplane_utils.ORACLE_HOST))
        m_execute_sql_command.assert_called_with('admin/admin@localhost/',
                                                 '@reinstall_plsql')
Example #4
0
    def test_clean_create_db(self, m_set_oracle_host, m_execute_sql_command,
                             m_system, m_chdir, m_set_oracle_env):
        cplane_utils.ORACLE_HOST = 'localhost'
        cplane_utils.clean_create_db()
#        m_set_oracle_env.assert_called_with()
        m_set_oracle_host.assert_called_with()
        m_system.assert_called_with('sh install.sh admin/admin@localhost/\
 2>&1 | tee install.log')
        m_execute_sql_command.assert_called_with('admin/admin@localhost/',
                                                 '@reinstall_plsql')
        m_system.assert_called_with('sh install.sh admin/admin@localhost/\
 2>&1 | tee install.log'.format(cplane_utils.ORACLE_HOST))
        m_execute_sql_command.assert_called_with('admin/admin@localhost/',
                                                 '@reinstall_plsql')