environments/stage/modules/registry/lib/puppet/provider/registry_value/registry.rb
# convert puppet type and data to native
convert puppet type and data to native
convert puppet type and data to native
def to_native(ptype, pdata)
    raise Puppet::Error, "Data should be an Array (ErrorID 37D9BBAB-52E8-4A7C-9F2E-D7BF16A59050)" unless pdata.kind_of?(Array)
    ndata =
      case ptype
      when :binary
        pdata.first.scan(/[a-f\d]{2}/i).map{ |byte| [byte].pack('H2') }.join('')
      when :array
        pdata
      else
        pdata.first
      end
    return [name2type(ptype), ndata]
  end
def to_native ( ptype , pdata ) raise Puppet :: Error , "Data should be an Array (ErrorID 37D9BBAB-52E8-4A7C-9F2E-D7BF16A59050)" unless pdata . kind_of? ( Array ) ndata = case ptype when :binary pdata . first . scan ( / [a-f \d ]{2} /i ) . map { | byte | [ byte ] . pack ( 'H2' ) } . join ( '' ) when :array pdata else pdata . first end return [ name2type ( ptype ) , ndata ] end
convert puppet type and data to native
convert puppet type and data to native
# JJM Because the data property is set to :array_matching => :all we # should always get an array from Puppet.  We need to convert this # array to something usable by the Win API. # We already have an array, and the native API write method takes an # array, so send it thru. # Since we have an array, take the first element and send it to the # native API which is expecting a scalar.
ptype
<not_specific>
pdata
<not_specific>