From 76a3a736cfb50cb1c6d926d1e3afb0f504818157 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 16 Nov 2012 14:30:20 -0800 Subject: added CSR ability (and vendored certificate_authority gem, so we can get the unreleased fixes we need). --- lib/leap_cli/util.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'lib/leap_cli/util.rb') diff --git a/lib/leap_cli/util.rb b/lib/leap_cli/util.rb index 9b04894..0b0fb9e 100644 --- a/lib/leap_cli/util.rb +++ b/lib/leap_cli/util.rb @@ -55,7 +55,7 @@ module LeapCli # def assert_bin!(cmd_name) assert! `which #{cmd_name}`.strip.any? do - log 0, :missing, "command '%s'" % cmd_name + log :missing, "command '%s'" % cmd_name end end @@ -68,9 +68,9 @@ module LeapCli output = `#{cmd}` unless $?.success? bail! do - log 0, :run, cmd - log 0, :failed, "(exit #{$?.exitstatus}) #{output}", :indent => 1 - log 0, message, :indent => 1 if message + log :run, cmd + log :failed, "(exit #{$?.exitstatus}) #{output}", :indent => 1 + log message, :indent => 1 if message end else log 2, :ran, cmd @@ -86,13 +86,13 @@ module LeapCli }.compact if file_list.length > 1 bail! do - log 0, :error, "Sorry, we can't continue because these files already exist: #{file_list.join(', ')}." - log 0, options[:msg] if options[:msg] + log :error, "Sorry, we can't continue because these files already exist: #{file_list.join(', ')}." + log options[:msg] if options[:msg] end elsif file_list.length == 1 bail! do - log 0, :error, "Sorry, we can't continue because this file already exists: #{file_list.first}." - log 0, options[:msg] if options[:msg] + log :error, "Sorry, we can't continue because this file already exists: #{file_list.first}." + log options[:msg] if options[:msg] end end end @@ -104,8 +104,8 @@ module LeapCli rescue NoMethodError rescue NameError end - assert! !value.nil? do - log 0, :missing, "configuration value for #{conf_path}" + assert! !value.nil? && value != "REQUIRED" do + log :missing, "required configuration value for #{conf_path}" end end @@ -117,13 +117,13 @@ module LeapCli }.compact if file_list.length > 1 bail! do - log 0, :missing, "these files: #{file_list.join(', ')}" - log 0, options[:msg] if options[:msg] + log :missing, "these files: #{file_list.join(', ')}" + log options[:msg] if options[:msg] end elsif file_list.length == 1 bail! do - log 0, :missing, "file #{file_list.first}" - log 0, options[:msg] if options[:msg] + log :missing, "file #{file_list.first}" + log options[:msg] if options[:msg] end end end -- cgit v1.2.3