libraries/resource_provider.rb
def save_res_info
      ov_url = @item.client.url.to_s
      case @new_resource.save_resource_info
      when Array # save subset
        @context.node.default['oneview'][ov_url][@name.to_s] = @item.data.select { |k, _v| @new_resource.save_resource_info.include?(k) }
      when TrueClass # save all
        @context.node.default['oneview'][ov_url][@name.to_s] = @item.data
      end
    rescue StandardError => e
      Chef::Log.error "Failed to save resource data for '#{@name}': #{e.message}"
    end
# Save the data from a resource to a node attribute
# @param [TrueClass, FalseClass, Array] attributes Attributes to save (or true/false)
# @param [String, Symbol] name Resource name
# @param [OneviewSDK::Resource] item to save data for
# (@new_resource.save_resource_info, @name, @item)
Save the data from a resource to a node attribute
Save the data from a resource to a node attribute
def save_res_info
      ov_url = @item.client.url.to_s
      case @new_resource.save_resource_info
      when Array 
        @context.node.default['oneview'][ov_url][@name.to_s] = @item.data.select { |k, _v| @new_resource.save_resource_info.include?(k) }
      when TrueClass 
        @context.node.default['oneview'][ov_url][@name.to_s] = @item.data
      end
    rescue StandardError => e
      Chef::Log.error "Failed to save resource data for '#{@name}': #{e.message}"
    end
def save_res_info ov_url = @item . client . url . to_s case @new_resource . save_resource_info when Array @context . node . default [ 'oneview' ] [ ov_url ] [ @name . to_s ] = @item . data . select { | k , _v | @new_resource . save_resource_info . include? ( k ) } when TrueClass @context . node . default [ 'oneview' ] [ ov_url ] [ @name . to_s ] = @item . data end rescue StandardError => e Chef :: Log . error "Failed to save resource data for '#{@name}': #{e.message}" end
Save the data from a resource to a node attribute
Save the data from a resource to a node attribute
# save subset # save all
item to save data for (@new_resource.save_resource_info, @name, @item)
item to save data for ( @new_resource . save_resource_info @name @item )