~ubuntu-branches/ubuntu/oneiric/puppet/oneiric-security

« back to all changes in this revision

Viewing changes to lib/puppet/type/file.rb

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Pollock
  • Date: 2009-04-13 17:12:47 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (3.1.3 squeeze) (1.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20090413171247-61zlnwi5esw1lhtv
ImportĀ upstreamĀ versionĀ 0.24.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
368
368
                        Find.find(self[:path]) do |f|
369
369
                            if File.file?(f)
370
370
                                sum = backup.backup(f)
371
 
                                self.info "Filebucketed %s to %s with sum %s" %
 
371
                                self.notice "Filebucketed %s to %s with sum %s" %
372
372
                                    [f, backup.name, sum]
373
373
                            end
374
374
                        end
403
403
                case backup
404
404
                when Puppet::Network::Client.client(:Dipper):
405
405
                    sum = backup.backup(file)
406
 
                    self.info "Filebucketed to %s with sum %s" %
 
406
                    self.notice "Filebucketed to %s with sum %s" %
407
407
                        [backup.name, sum]
408
408
                    return true
409
409
                when String:
849
849
            # Keep track of all the files we found in the source, so we can purge
850
850
            # appropriately.
851
851
            sourced = []
 
852
 
 
853
            success = false
852
854
            
853
855
            @parameters[:source].should.each do |source|
854
856
                sourceobj, path = uri2obj(source)
863
865
                if desc == "" 
864
866
                    next
865
867
                end
 
868
 
 
869
                success = true
866
870
            
867
871
                # Now create a new child for every file returned in the list.
868
872
                result += desc.split("\n").collect { |line|
898
902
                    return [result, sourced]
899
903
                end
900
904
            end
 
905
 
 
906
            unless success
 
907
                raise Puppet::Error, "None of the provided sources exist"
 
908
            end
 
909
 
901
910
            return [result, sourced]
902
911
        end
903
912
 
1118
1127
        # file creation/modification, so we have to do some extra checking.
1119
1128
        def property_fix
1120
1129
            properties.each do |thing|
1121
 
                next unless [:mode, :owner, :group].include?(thing.name)
 
1130
                next unless [:mode, :owner, :group, :seluser, :selrole, :seltype, :selrange].include?(thing.name)
1122
1131
 
1123
1132
                # Make sure we get a new stat objct
1124
1133
                self.stat(true)
1148
1157
    require 'puppet/type/file/group'
1149
1158
    require 'puppet/type/file/mode'
1150
1159
    require 'puppet/type/file/type'
 
1160
    require 'puppet/type/file/selcontext'  # SELinux file context
1151
1161
end