Skip to content

Commit

Permalink
Merge pull request #12675 from martinpovolny/console_config
Browse files Browse the repository at this point in the history
Add settings key to disable console proxy
(cherry picked from commit 5271c91)

https://bugzilla.redhat.com/show_bug.cgi?id=1399677
  • Loading branch information
Fryguy authored and simaishi committed Jan 6, 2017
1 parent b40336a commit b603479
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/models/system_console.rb
Expand Up @@ -24,8 +24,8 @@ def destroy_or_mark
end

def self.allocate_port
port_range_start = ::Settings.server.proxy_port.try(:start) || 6000
port_range_end = ::Settings.server.proxy_port.try(:end) || 7000
port_range_start = ::Settings.server.proxy_port.start || 6000
port_range_end = ::Settings.server.proxy_port.end || 7000

used_ports = SystemConsole.where.not(:proxy_pid => nil).where(:host_name => local_address).order(:port).pluck(:port)

Expand Down Expand Up @@ -93,8 +93,12 @@ def self.is_local?(originating_server)
end

def self.launch_proxy_if_not_local(console_args, originating_server, host_address, host_port)
proxy_disabled = ::Settings.server.console_proxy_disabled
proxy_disabled = proxy_disabled.present? && !proxy_disabled

_log.info "Originating server: #{originating_server}, local server: #{MiqServer.my_server.id}"
if SystemConsole.is_local?(originating_server)

if proxy_disabled || SystemConsole.is_local?(originating_server)
console_args.update(
:host_name => host_address,
:port => host_port,
Expand Down

0 comments on commit b603479

Please sign in to comment.