summaryrefslogtreecommitdiffstats
path: root/lib/puppet/file_serving/mount.rb
blob: 7ee11a99b2d2b1abe596f9ba1bcc07b6d4992117 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#
#  Created by Luke Kanies on 2007-10-16.
#  Copyright (c) 2007. All rights reserved.

require 'puppet/network/authstore'
require 'puppet/util/logging'
require 'puppet/util/cacher'
require 'puppet/file_serving'
require 'puppet/file_serving/metadata'
require 'puppet/file_serving/content'

# Broker access to the filesystem, converting local URIs into metadata
# or content objects.
class Puppet::FileServing::Mount < Puppet::Network::AuthStore
    include Puppet::Util::Logging

    attr_reader :name

    def find(path, options)
        raise NotImplementedError
    end

    # Create our object.  It must have a name.
    def initialize(name)
        unless name =~ %r{^[-\w]+$}
            raise ArgumentError, "Invalid mount name format '%s'" % name
        end
        @name = name

        super()
    end

    def search(path, options)
        raise NotImplementedError
    end

    def to_s
        "mount[%s]" % @name
    end

    # A noop.
    def validate
    end
end