summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/log_paths.rb
blob: e09ceb7fa725753dc5c782f37a8d990ade07b9d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#  Created by Luke Kanies on 2007-07-04.
#  Copyright (c) 2007. All rights reserved.

module Puppet::Util::LogPaths
    # return the full path to us, for logging and rollback
    # some classes (e.g., FileTypeRecords) will have to override this
    def path
        @path ||= pathbuilder

        "/" + @path.join("/")
    end

    def source_descriptors
        descriptors = {}

        descriptors[:tags] = tags

        [:path, :file, :line, :version].each do |param|
            next unless value = send(param)
            descriptors[param] = value
        end

        descriptors
    end

end