From 6f0cd3565ef8bda83be1ce4a3fc682b509768993 Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Fri, 12 Apr 2024 11:15:21 -0400 Subject: [PATCH] Start evmserverd after cli config --- lib/manageiq/appliance_console/cli.rb | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/manageiq/appliance_console/cli.rb b/lib/manageiq/appliance_console/cli.rb index 3bbc391c..5dba2bd0 100644 --- a/lib/manageiq/appliance_console/cli.rb +++ b/lib/manageiq/appliance_console/cli.rb @@ -241,6 +241,10 @@ def region_number_required? !options[:standalone] && local_database? && !database_admin? end + def run_as_evm_server? + ManageIQ::ApplianceConsole::EvmServer.runnable? + end + def run Optimist.educate unless set_host? || key? || database? || db_dump? || db_backup? || db_restore? || tmp_disk? || log_disk? || @@ -279,6 +283,7 @@ def run message_server_unconfig if message_server_unconfig? message_client_config if message_client_config? message_client_unconfig if message_client_unconfig? + start_evm_server if run_as_evm_server? rescue CliError => e say(e.message) say("") @@ -322,9 +327,6 @@ def set_internal_db # start pg, create user, create db update the rails configuration, # verify, set up the database with region. activate does it all! raise CliError, "Failed to configure internal database" unless config.activate - - # enable/start related services - config.post_activation rescue RuntimeError => e raise CliError, "Failed to configure internal database #{e.message}" end @@ -343,9 +345,6 @@ def set_external_db # call create_or_join_region (depends on region value) raise CliError, "Failed to configure external database" unless config.activate - - # enable/start related services - config.post_activation end def set_replication @@ -527,6 +526,12 @@ def message_client_unconfig MessageClientConfiguration.new(options).unconfigure end + def start_evm_server + return if ManageIQ::ApplianceConsole::EvmServer.running? + + ManageIQ::ApplianceConsole::EvmServer.start + end + def set_server_state case options[:server] when "start"