libraries/resource_providers/api200/logical_interconnect_provider.rb
def update_handler(action, key = nil)
        temp = key ? { key.to_s => Marshal.load(Marshal.dump(@item[key])) } : Marshal.load(Marshal.dump(@item.data))
        @item.retrieve! || raise("#{@resource_name} '#{@name}' not found!")
        return Chef::Log.info("#{@resource_name} '#{@name}' is up to date") if @item.like?(temp)
        diff = get_diff(@item, temp)
        Chef::Log.info "#{action.to_s.capitalize.tr('_', ' ')} #{@resource_name} '#{@name}'#{diff}"
        Chef::Log.debug "#{@resource_name} '#{@name}' Chef resource differs from OneView resource."
        Chef::Log.debug "Current state: #{JSON.pretty_generate(@item.data)}"
        Chef::Log.debug "Desired state: #{JSON.pretty_generate(temp)}"
        recursive_set(@item.data, temp)
        @context.converge_by "#{action.to_s.capitalize.tr('_', ' ')} #{@resource_name} '#{@name}'" do
          @item.send(action)
        end
      end
# Handle the most types of updates
Handle the most types of updates
Handle the most types of updates
def update_handler(action, key = nil)
        temp = key ? { key.to_s => Marshal.load(Marshal.dump(@item[key])) } : Marshal.load(Marshal.dump(@item.data))
        @item.retrieve! || raise("#{@resource_name} '#{@name}' not found!")
        return Chef::Log.info("#{@resource_name} '#{@name}' is up to date") if @item.like?(temp)
        diff = get_diff(@item, temp)
        Chef::Log.info "#{action.to_s.capitalize.tr('_', ' ')} #{@resource_name} '#{@name}'#{diff}"
        Chef::Log.debug "#{@resource_name} '#{@name}' Chef resource differs from OneView resource."
        Chef::Log.debug "Current state: #{JSON.pretty_generate(@item.data)}"
        Chef::Log.debug "Desired state: #{JSON.pretty_generate(temp)}"
        recursive_set(@item.data, temp)
        @context.converge_by "#{action.to_s.capitalize.tr('_', ' ')} #{@resource_name} '#{@name}'" do
          @item.send(action)
        end
      end
def update_handler ( action , key = nil ) temp = key ? { key . to_s => Marshal . load ( Marshal . dump ( @item [ key ] ) ) } : Marshal . load ( Marshal . dump ( @item . data ) ) @item . retrieve! || raise ( "#{@resource_name} '#{@name}' not found!" ) return Chef :: Log . info ( "#{@resource_name} '#{@name}' is up to date" ) if @item . like? ( temp ) diff = get_diff ( @item , temp ) Chef :: Log . info "#{action.to_s.capitalize.tr('_', ' ')} #{@resource_name} '#{@name}'#{diff}" Chef :: Log . debug "#{@resource_name} '#{@name}' Chef resource differs from OneView resource." Chef :: Log . debug "Current state: #{JSON.pretty_generate(@item.data)}" Chef :: Log . debug "Desired state: #{JSON.pretty_generate(temp)}" recursive_set ( @item . data , temp ) @context . converge_by "#{action.to_s.capitalize.tr('_', ' ')} #{@resource_name} '#{@name}'" do @item . send ( action ) end end
Handle the most types of updates
Handle the most types of updates
action
key