Class: KPM::PluginsController

Inherits:
EngineController show all
Defined in:
app/controllers/kpm/plugins_controller.rb

Instance Method Summary collapse

Methods inherited from EngineController

#current_tenant_user, #get_layout, #options_for_klient

Instance Method Details

#indexObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/kpm/plugins_controller.rb', line 7

def index
  nodes_by_kb_version, @kb_version = killbill_version
  @warning_message = ''
  @plugins = {}
  if !nodes_by_kb_version.nil? && nodes_by_kb_version.size > 1
    @warning_message = different_versions_warning_message(nodes_by_kb_version)
  else
    full_kb_version = nodes_by_kb_version.nil? ? 'LATEST' : nodes_by_kb_version.keys.first
    begin
       = ::Killbill::KPM::KPMClient.get_available_plugins(full_kb_version, true, options_for_klient)
    rescue StandardError => e
      # No connectivity or version not in Nexus
      Rails.logger.warn("Unable to get latest plugins for version #{full_kb_version}: #{e.inspect}")
       = ::Killbill::KPM::KPMClient.get_available_plugins('LATEST', false, options_for_klient)
    end
    @plugins = ['plugins'].sort.to_h
  end
end