libraries/_osgi_component_helper.rb
# Component operation returns complete list of OSGi components. It needs to
# be filtered
Component operation returns complete list of OSGi components. It needs to
be filtered
Component operation returns complete list of OSGi components . It needs to be filtered
def valid_component_op?(addr, user, password, http_resp, expected_state, pid, hc_params)
      if http_resp.code != '200'
        Chef::Log.error(
          "OSGi component action ended with #{http_resp.code} code (expected "\
          "200) and #{http_resp.body} body"
        )
        return false
      end
      max_checks = 4
      max_checks.times do |i|
        info = component_get(addr, user, password, pid)
        Chef::Log.debug(
          "[#{i + 1}/#{max_checks}] Current component info: #{info}"
        )
        return true if info['state'] == expected_state
        sleep hc_params['sleep_time']
        Chef::Log.error(
          "Expected #{expected_state} state, but got #{info['state']} after "\
          "#{max_checks} checks"
        ) if i == max_checks - 1
      end
      false
    end
def valid_component_op? ( addr , user , password , http_resp , expected_state , pid , hc_params ) if http_resp . code != '200' Chef :: Log . error ( "OSGi component action ended with #{http_resp.code} code (expected " "200) and #{http_resp.body} body" ) return false end max_checks = 4 max_checks . times do | i | info = component_get ( addr , user , password , pid ) Chef :: Log . debug ( "[#{i + 1}/#{max_checks}] Current component info: #{info}" ) return true if info [ 'state' ] == expected_state sleep hc_params [ 'sleep_time' ] Chef :: Log . error ( "Expected #{expected_state} state, but got #{info['state']} after " "#{max_checks} checks" ) if i == max_checks - 1 end false end
Component operation returns complete list of OSGi components.
Component operation returns complete list of OSGi components .
# Check if POST request was successful # Call API again to check component state
addr
<not_specific>
user
<not_specific>
password
<not_specific>
http_resp
<not_specific>
expected_state
<not_specific>
pid
<not_specific>
hc_params
<not_specific>