Module: Cluster::Base
Instance Attribute Summary
#done_validating, #original_args, #valid
Instance Method Summary
collapse
#can_change_user?, #config_keys, #failure, #help, #initialize, #load_config, #options, #valid?, #valid_dir?, #valid_exists?, #valid_file?, #valid_group?, #valid_user?
Instance Method Details
7
8
9
10
11
12
|
# File 'lib/golden_brindle/cluster.rb', line 7
def configure
options [
["-c", "--conf_path PATH", "Path to golden_brindle configuration files", :@cwd, "."],
["-V", "", "Verbose output", :@verbose, false]
]
end
|
#run ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/golden_brindle/cluster.rb', line 20
def run
command = self.class.to_s.downcase.split('::')[1]
counter = 0
errors = 0
Dir.chdir @cwd do
Dir.glob("**/*.{yml,conf}").each do |conf|
cmd = "golden_brindle #{command} -C #{conf}"
cmd += " -d" if command == "start" puts cmd if @verbose
output = `#{cmd}`
puts output if @verbose
status = $?.success?
puts "golden_brindle #{command} returned an error." unless status
status ? counter += 1 : errors += 1
end
end
puts "Success:#{counter}; Errors: #{errors}"
end
|
#validate ⇒ Object
14
15
16
17
18
|
# File 'lib/golden_brindle/cluster.rb', line 14
def validate
@cwd = File.expand_path(@cwd)
valid_dir? @cwd, "Invalid path to golden_brindle configuration files: #{@cwd}"
@valid
end
|