Issue #13199 has been updated by Ken Barber.

Status changed from Investigating to Accepted
Assignee deleted (Ken Barber)
Affected Puppet version set to 2.7.14

I think I've pretty much established this is true, but alas - its not a quick 
fix.
----------------------------------------
Bug #13199: md5lite, mtime not honoured for file type/provider
https://projects.puppetlabs.com/issues/13199#change-62554

Author: Ken Barber
Status: Accepted
Priority: Normal
Assignee: 
Category: file
Target version: 
Affected Puppet version: 2.7.14
Keywords: 
Branch: 


It seems I can't get the puppetmaster to honour the checksum => mtime setting, 
or the md5lite setting. So the following example has no performance improvement 
over just using md5:

    file { "/testtransfer":
      ensure => directory,
      recurse => remote,
      purge => true,
      checksum => mtime,
      source => "puppet:///modules/${module_name}/bigfileshere",
    }

The problem seems to be in multiple places. The first place, I can't get the 
file_server/metadata to respond with mtime, md5lite checksums:

    # curl -k --cert /etc/puppetlabs/pupem --key 
/etc/puppetlabs/puppet/ssl/private_keys/puppetclient2.vm.pem --cacert 
/etc/puppetlabs/puppet/ssl/certs/ca.pem -H 'Accept: yaml' 
'https://puppet:8140/production/file_metadatas/modules/filetransfer/sles/SLES-11-SP1-DVD-x86_64-GM-DVD1.iso
 checksum_type=md5lite'
    --- 
      - !ruby/object:Puppet::FileServing::Metadata
        checksum: "{md5}d2e10420f3689faa49a004b60fb396b7"
        checksum_type: md5
        destination: 
        expiration: 2012-03-16 17:49:23.600743 -07:00
        ftype: file
        group: 0
        links: !ruby/sym manage
        mode: 420
        owner: 0
        path: 
/etc/puppetlabs/puppet/modules/filetransfer/files/sles/SLES-11-SP1-DVD-x86_64-GM-DVD1.iso
        relative_path: .
        stat_method: !ruby/sym lstat

This is fixed with this patch:

    diff --git a/lib/puppet/indirector/file_server.rb 
b/lib/puppet/indirector/file_server.rb
    index 9516a40..9fbd57e 100644
    --- a/lib/puppet/indirector/file_server.rb
    +++ b/lib/puppet/indirector/file_server.rb
    @@ -51,6 +51,7 @@ class Puppet::Indirector::FileServer < 
Puppet::Indirector::Terminus
         Puppet::FileServing::Fileset.merge(*filesets).collect do |file, 
base_path|
           inst = model.new(base_path, :relative_path => file)
           inst.links = request.options[:links] if request.options[:links]
    +      inst.checksum_type = request.options[:checksum_type] if 
request.options[:checksum_type]
           inst.collect
           inst
         end

Which does the correct thing:

    # curl -k --cert /etc/puppetlabs/puppet/ssl/certs/puppetclient2.vm.pem 
--key /etc/puppetlabs/puppet/ssl/private_keys/puppetclient2.vm.pem --cacert 
/etc/puppetlabs/puppet/ssl/certs/ca.pem -H 'Accept: yaml' 
'https://puppet:8140/production/file_metadatas/modules/filetransfer/sles/SLES-11-SP1-DVD-x86_64-GM-DVD1.iso?checksum_type=md5lite'
    --- 
      - !ruby/object:Puppet::FileServing::Metadata
        checksum: "{md5lite}bf619eac0cdf3f68d496ea9344137e8b"
        checksum_type: md5lite
        destination: 
        expiration: 2012-03-16 17:51:43.033651 -07:00
        ftype: file
        group: 0
        links: !ruby/sym manage
        mode: 420
        owner: 0
        path: 
/etc/puppetlabs/puppet/modules/filetransfer/files/sles/SLES-11-SP1-DVD-x86_64-GM-DVD1.iso
        relative_path: .
        stat_method: !ruby/sym lstat

The second problem seems to be in the provider itself, it seems to me as if its 
still trying to do an md5 scan on the local filesystem - but I'll have to dig 
deeper to find the root cause for this.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to