Class: OS::Puppet::Fencing::FencingRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/fencing.rb

Instance Method Summary collapse

Constructor Details

#initialize(config_location, nodes_location) ⇒ FencingRunner

Returns a new instance of FencingRunner.



14
15
16
17
18
19
20
21
22
# File 'lib/fencing.rb', line 14

def initialize(config_location, nodes_location)
	Log.log("Fencing runner started")
	config_json = JSON.parse(File.read(config_location))
	config = OS::Puppet::Fencing::Config.new(config_json)
	facter_adapter = OS::Puppet::Fencing::FacterAdapter.new
	@classifier = OS::Puppet::Fencing::Classifier.new(config, facter_adapter)
	@resolver = OS::Puppet::Fencing::NodeResolver.new(nodes_location)

end

Instance Method Details

#lookup(host_name) ⇒ Object



24
25
26
27
# File 'lib/fencing.rb', line 24

def lookup(host_name)
	node_file_name = @classifier.resolve_node(host_name)
	node_definition = @resolver.resolve(node_file_name)
end