2013-04-15 17:27:39 +09:00

12 lines
227 B
Ruby

def resource_exists?(name)
cmd = Mixlib::ShellOut.new("crm configure show | grep #{name}")
cmd.environment['HOME'] = ENV.fetch('HOME', '/root')
cmd.run_command
begin
cmd.error!
true
rescue
false
end
end