Skip to content

Commit

Permalink
Start evmserverd after cli config
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Apr 12, 2024
1 parent c1001f8 commit 6f0cd35
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/manageiq/appliance_console/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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? ||
Expand Down Expand Up @@ -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("")
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 6f0cd35

Please sign in to comment.