Skip to content

Commit

Permalink
Fixes #27088 - Handle capabilities for uninitialized plugins
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Zapletal <[email protected]>
  • Loading branch information
lzap authored and ekohl committed Mar 4, 2022
1 parent 71c07db commit c0980f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/root/root_v2_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Proxy::RootV2Api < Sinatra::Base
end

def process_capabilities(state, capabilities)
return [] if state == :uninitialized
capabilities = capabilities.select { |cap| !cap.is_a?(Proc) || state == :running }
capabilities = capabilities.map do |capability|
capability.is_a?(Proc) ? capability.call : capability
Expand Down
2 changes: 1 addition & 1 deletion test/bmc/integration_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'test_helper'
require 'json'
require 'root/root_v2_api'
require 'bmc/bmc'
require 'bmc/bmc_plugin'
require 'bmc/ipmi'

class BmcApiFeaturesTest < Test::Unit::TestCase
Expand Down

0 comments on commit c0980f9

Please sign in to comment.