blob: 5bfcec95de716c005e478b51d59d4f7ad271902d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
require 'puppet/indirector/terminus'
# Manage a memory-cached list of instances.
class Puppet::Indirector::Memory < Puppet::Indirector::Terminus
def initialize
@instances = {}
end
def destroy(instance)
raise ArgumentError.new("Could not find %s to destroy" % instance) unless @instances.include?(instance.name)
@instances.delete(instance.name)
end
def find(name)
@instances[name]
end
def save(instance)
@instances[instance.name] = instance
end
end
|