def massage(value, ref)
      Cisco::Logger.debug "Massaging '#{value}' (#{value.inspect})"
      value = drill_down_structured(value, ref)
      if value.is_a?(Array) && !ref.multiple
        fail "Expected zero/one value but got '#{value}'" if value.length > 1
        value = value[0]
      end
      if (value.nil? || value.to_s.empty?) &&
         ref.default_value? && ref.auto_default
        Cisco::Logger.debug "Default: #{ref.default_value}"
        return ref.default_value
      end
      if ref.multiple && ref.hash['get_data_format'] == :nxapi_structured
        return value if value.nil?
        value = [value.to_s] if value.is_a?(String) || value.is_a?(Fixnum)
      end
      return value unless ref.kind
      value = massage_kind(value, ref)
      Cisco::Logger.debug "Massaged to '#{value}'"
      value
    end
def massage(value, ref)
      Cisco::Logger.debug "Massaging '#{value}' (#{value.inspect})"
      value = drill_down_structured(value, ref)
      if value.is_a?(Array) && !ref.multiple
        fail "Expected zero/one value but got '#{value}'" if value.length > 1
        value = value[0]
      end
      if (value.nil? || value.to_s.empty?) &&
         ref.default_value? && ref.auto_default
        Cisco::Logger.debug "Default: #{ref.default_value}"
        return ref.default_value
      end
      if ref.multiple && ref.hash['get_data_format'] == :nxapi_structured
        return value if value.nil?
        value = [value.to_s] if value.is_a?(String) || value.is_a?(Fixnum)
      end
      return value unless ref.kind
      value = massage_kind(value, ref)
      Cisco::Logger.debug "Massaged to '#{value}'"
      value
    end
Attempt to massage the given value into the format specified by the
 given CmdRef object.