def test_cplane_installer_upgrade(self, m_set_config, m_set_oracle_host, m_json_dump, m_json_load, m_chdir, m_prepare_database, m_load_config, m_check_call): cplane_utils.CONTROLLER_CONFIG = 'cplane-dvnd-config.yaml' cplane_utils.cplane_installer() m_set_oracle_host.assert_called_with() m_check_call.assert_called_with(['sh', 'cpinstaller', 'cplane-dvnd-config.yaml'])
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 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')
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')
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 install(): apt_update(fatal=True) pkgs = determine_packages() apt_install(pkgs, fatal=True) prepare_env() flush_upgrade_type() download_cplane_packages() install_jboss() install_jdk() cmd = "echo '#Added by cplane' >> /etc/hosts" os.system(cmd) if config('jboss-db-on-host'): install_oracle() configure_oracle() else: install_oracle_client() configure_oracle_client() cplane_installer() if config('intall-reboot-scripts') == 'y': install_reboot_scripts()