dtk-client 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/dtk-client.gemspec +2 -2
- data/lib/auxiliary.rb +1 -1
- data/lib/client.rb +1 -1
- data/lib/command_helper.rb +1 -1
- data/lib/command_helpers/git_repo/merge.rb +1 -1
- data/lib/command_helpers/git_repo.rb +1 -1
- data/lib/command_helpers/jenkins_client/config_xml.rb +1 -1
- data/lib/command_helpers/jenkins_client.rb +1 -1
- data/lib/command_helpers/service_importer.rb +6 -2
- data/lib/command_helpers/service_link.rb +1 -1
- data/lib/command_helpers/test_module_creator.rb +1 -1
- data/lib/commands/common/thor/access_control.rb +1 -1
- data/lib/commands/common/thor/action_result_handler.rb +57 -57
- data/lib/commands/common/thor/assembly_template.rb +1 -1
- data/lib/commands/common/thor/assembly_workspace.rb +15 -5
- data/lib/commands/common/thor/base_command_helper.rb +1 -1
- data/lib/commands/common/thor/clone.rb +1 -1
- data/lib/commands/common/thor/common.rb +1 -1
- data/lib/commands/common/thor/common_base.rb +1 -1
- data/lib/commands/common/thor/create_target.rb +1 -1
- data/lib/commands/common/thor/edit.rb +1 -1
- data/lib/commands/common/thor/inventory_parser.rb +1 -1
- data/lib/commands/common/thor/list_diffs.rb +111 -111
- data/lib/commands/common/thor/module/import.rb +1 -1
- data/lib/commands/common/thor/module.rb +18 -5
- data/lib/commands/common/thor/node.rb +1 -1
- data/lib/commands/common/thor/poller.rb +1 -1
- data/lib/commands/common/thor/pull_clone_changes.rb +1 -1
- data/lib/commands/common/thor/pull_from_remote.rb +1 -1
- data/lib/commands/common/thor/puppet_forge.rb +1 -1
- data/lib/commands/common/thor/purge_clone.rb +1 -1
- data/lib/commands/common/thor/push_clone_changes.rb +1 -1
- data/lib/commands/common/thor/push_to_remote.rb +1 -1
- data/lib/commands/common/thor/remotes.rb +1 -1
- data/lib/commands/common/thor/reparse.rb +1 -1
- data/lib/commands/common/thor/set_required_attributes.rb +1 -1
- data/lib/commands/thor/account.rb +1 -1
- data/lib/commands/thor/assembly.rb +1 -1
- data/lib/commands/thor/attribute.rb +1 -1
- data/lib/commands/thor/component.rb +1 -1
- data/lib/commands/thor/component_module.rb +1 -1
- data/lib/commands/thor/component_template.rb +1 -1
- data/lib/commands/thor/dependency.rb +1 -1
- data/lib/commands/thor/developer.rb +127 -127
- data/lib/commands/thor/dtk.rb +1 -1
- data/lib/commands/thor/library.rb +1 -1
- data/lib/commands/thor/node.rb +1 -1
- data/lib/commands/thor/node_group.rb +1 -1
- data/lib/commands/thor/node_template.rb +1 -1
- data/lib/commands/thor/project.rb +17 -17
- data/lib/commands/thor/provider.rb +7 -5
- data/lib/commands/thor/remotes.rb +1 -1
- data/lib/commands/thor/service.rb +18 -3
- data/lib/commands/thor/service_module.rb +1 -1
- data/lib/commands/thor/target.rb +233 -231
- data/lib/commands/thor/task.rb +1 -1
- data/lib/commands/thor/test_module.rb +1 -1
- data/lib/commands/thor/workspace.rb +22 -3
- data/lib/commands.rb +40 -40
- data/lib/config/configuration.rb +1 -1
- data/lib/config/disk_cacher.rb +1 -1
- data/lib/configurator.rb +1 -1
- data/lib/context_router.rb +1 -1
- data/lib/core.rb +1 -1
- data/lib/domain/git_adapter.rb +395 -395
- data/lib/domain/git_error_handler.rb +47 -47
- data/lib/domain/response/error_handler.rb +13 -4
- data/lib/domain/response.rb +1 -1
- data/lib/dtk-client/version.rb +3 -3
- data/lib/dtk_client.rb +1 -1
- data/lib/dtk_constants.rb +1 -1
- data/lib/dtk_error.rb +1 -1
- data/lib/dtk_logger.rb +96 -96
- data/lib/error.rb +1 -1
- data/lib/execute/cli_pure/cli_rerouter.rb +1 -1
- data/lib/execute/command/api_call/map.rb +1 -1
- data/lib/execute/command/api_call/service.rb +1 -1
- data/lib/execute/command/api_call/translation_term.rb +1 -1
- data/lib/execute/command/api_call.rb +1 -1
- data/lib/execute/command/rest_call.rb +1 -1
- data/lib/execute/command.rb +1 -1
- data/lib/execute/command_processor/rest_call.rb +1 -1
- data/lib/execute/command_processor.rb +1 -1
- data/lib/execute/execute_context/result_store.rb +1 -1
- data/lib/execute/execute_context.rb +1 -1
- data/lib/execute/script/add_tenant.rb +1 -1
- data/lib/execute/script.rb +1 -1
- data/lib/execute.rb +1 -1
- data/lib/parser/adapters/option_parser.rb +1 -1
- data/lib/parser/adapters/thor/common_option_defs.rb +1 -1
- data/lib/parser/adapters/thor.rb +1 -1
- data/lib/require_first.rb +87 -87
- data/lib/search_hash.rb +1 -1
- data/lib/shell/context.rb +1 -1
- data/lib/shell/context_aux.rb +1 -1
- data/lib/shell/domain/active_context.rb +1 -1
- data/lib/shell/domain/context_entity.rb +1 -1
- data/lib/shell/domain/context_params.rb +1 -1
- data/lib/shell/domain/override_tasks.rb +1 -1
- data/lib/shell/domain/shadow_entity.rb +1 -1
- data/lib/shell/header_shell.rb +1 -1
- data/lib/shell/help_monkey_patch.rb +1 -1
- data/lib/shell/interactive_wizard.rb +1 -1
- data/lib/shell/message_queue.rb +1 -1
- data/lib/shell/parse_monkey_patch.rb +1 -1
- data/lib/shell/status_monitor.rb +107 -107
- data/lib/shell.rb +1 -1
- data/lib/task_status/refresh_mode.rb +1 -1
- data/lib/task_status/snapshot_mode.rb +1 -1
- data/lib/task_status/stream_mode/element/format.rb +1 -1
- data/lib/task_status/stream_mode/element/hierarchical_task/result/action.rb +1 -1
- data/lib/task_status/stream_mode/element/hierarchical_task/result.rb +1 -1
- data/lib/task_status/stream_mode/element/hierarchical_task/steps/action.rb +1 -1
- data/lib/task_status/stream_mode/element/hierarchical_task/steps/components.rb +1 -1
- data/lib/task_status/stream_mode/element/hierarchical_task/steps/node_level.rb +1 -1
- data/lib/task_status/stream_mode/element/hierarchical_task/steps.rb +1 -1
- data/lib/task_status/stream_mode/element/hierarchical_task.rb +1 -1
- data/lib/task_status/stream_mode/element/render.rb +1 -1
- data/lib/task_status/stream_mode/element/stage/render.rb +1 -1
- data/lib/task_status/stream_mode/element/stage.rb +1 -1
- data/lib/task_status/stream_mode/element/task_end.rb +1 -1
- data/lib/task_status/stream_mode/element/task_start.rb +1 -1
- data/lib/task_status/stream_mode/element.rb +1 -1
- data/lib/task_status/stream_mode.rb +1 -1
- data/lib/task_status.rb +1 -1
- data/lib/util/common_util.rb +1 -1
- data/lib/util/console.rb +1 -1
- data/lib/util/dtk_puppet.rb +1 -1
- data/lib/util/module_util.rb +1 -1
- data/lib/util/os_util.rb +6 -2
- data/lib/util/permission_util.rb +1 -1
- data/lib/util/remote_dependency_util.rb +1 -1
- data/lib/util/ssh_util.rb +77 -77
- data/lib/view_processor/augmented_simple_list.rb +1 -1
- data/lib/view_processor/hash_pretty_print.rb +1 -1
- data/lib/view_processor/simple_list.rb +1 -1
- data/lib/view_processor/table_print.rb +1 -1
- data/lib/view_processor.rb +1 -1
- data/spec/lib/spec_helper.rb +1 -1
- data/spec/lib/spec_thor.rb +1 -1
- data/spec/node_template_spec.rb +1 -1
- data/spec/table_print_spec.rb +1 -1
- data/spec/target_spec.rb +1 -1
- data/spec/task_spec.rb +1 -1
- metadata +20 -20
@@ -15,50 +15,50 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
|
-
|
19
|
-
module DTK
|
20
|
-
module Client
|
21
|
-
|
22
|
-
class GitHandledException < Exception
|
23
|
-
def initialize(msg, backtrace)
|
24
|
-
super(msg)
|
25
|
-
set_backtrace(backtrace)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
class GitErrorHandler
|
30
|
-
|
31
|
-
# due to problems with git logging messages which are not user friendly we are going to wrap their error and try to produce more readable results
|
32
|
-
def self.handle(exception)
|
33
|
-
handled_exception = exception
|
34
|
-
|
35
|
-
if exception.is_a? Git::GitExecuteError
|
36
|
-
error_message = user_friendly_message(exception.message)
|
37
|
-
handled_exception = GitHandledException.new(error_message, exception.backtrace)
|
38
|
-
end
|
39
|
-
|
40
|
-
handled_exception
|
41
|
-
end
|
42
|
-
|
43
|
-
private
|
44
|
-
|
45
|
-
def self.user_friendly_message(message)
|
46
|
-
case message
|
47
|
-
when /repository not found/i
|
48
|
-
"Repository not found"
|
49
|
-
when /repository (.*) not found/i
|
50
|
-
"Repository #{$1.strip()} not found"
|
51
|
-
when /destination path (.*) already exists/i
|
52
|
-
"Destination folder #{$1.strip()} already exists"
|
53
|
-
when /Authentication failed for (.*)$/i
|
54
|
-
"Authentication failed for given repository #{$1.strip()}"
|
55
|
-
when /timed out/
|
56
|
-
"Timeout - not able to contact remote"
|
57
|
-
else
|
58
|
-
message
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
18
|
+
|
19
|
+
module DTK
|
20
|
+
module Client
|
21
|
+
|
22
|
+
class GitHandledException < Exception
|
23
|
+
def initialize(msg, backtrace)
|
24
|
+
super(msg)
|
25
|
+
set_backtrace(backtrace)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class GitErrorHandler
|
30
|
+
|
31
|
+
# due to problems with git logging messages which are not user friendly we are going to wrap their error and try to produce more readable results
|
32
|
+
def self.handle(exception)
|
33
|
+
handled_exception = exception
|
34
|
+
|
35
|
+
if exception.is_a? Git::GitExecuteError
|
36
|
+
error_message = user_friendly_message(exception.message)
|
37
|
+
handled_exception = GitHandledException.new(error_message, exception.backtrace)
|
38
|
+
end
|
39
|
+
|
40
|
+
handled_exception
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def self.user_friendly_message(message)
|
46
|
+
case message
|
47
|
+
when /repository not found/i
|
48
|
+
"Repository not found"
|
49
|
+
when /repository (.*) not found/i
|
50
|
+
"Repository #{$1.strip()} not found"
|
51
|
+
when /destination path (.*) already exists/i
|
52
|
+
"Destination folder #{$1.strip()} already exists"
|
53
|
+
when /Authentication failed for (.*)$/i
|
54
|
+
"Authentication failed for given repository #{$1.strip()}"
|
55
|
+
when /timed out/
|
56
|
+
"Timeout - not able to contact remote"
|
57
|
+
else
|
58
|
+
message
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -31,11 +31,14 @@ module DTK; module Client
|
|
31
31
|
DefaultErrorMsg = 'Internal DTK Client error, please try again'
|
32
32
|
|
33
33
|
Info = Struct.new(:msg,:code,:backtrace)
|
34
|
-
def self.error_info?(response,opts={})
|
34
|
+
def self.error_info?(response, opts={})
|
35
35
|
unless errors = response["errors"]
|
36
36
|
return (opts[:default_error_if_nil] && error_info_default())
|
37
37
|
end
|
38
38
|
|
39
|
+
# special rare case
|
40
|
+
errors = errors.first["errors"] if errors.is_a?(Array) && errors.first["errors"]
|
41
|
+
|
39
42
|
error_msg = ""
|
40
43
|
error_internal = nil
|
41
44
|
error_backtrace = nil
|
@@ -46,24 +49,30 @@ module DTK; module Client
|
|
46
49
|
errors.each do |err|
|
47
50
|
error_msg += err["message"] unless err["message"].nil?
|
48
51
|
error_msg += err["error"] unless err["error"].nil?
|
52
|
+
error_msg += OsUtil.remove_html_tags(err["original_exception"].to_s) unless err["original_exception"].nil?
|
49
53
|
error_on_server = true unless err["on_client"]
|
50
54
|
error_code = err["code"]||(err["errors"] && err["errors"].first["code"])
|
51
55
|
error_internal ||= (err["internal"] or error_code == "not_found") #"not_found" code is at Ramaze level; so error_internal not set
|
52
56
|
error_backtrace ||= err["backtrace"]
|
53
57
|
end
|
54
58
|
|
59
|
+
# in case we could not parse error lets log error info
|
60
|
+
if error_msg.empty?
|
61
|
+
DtkLogger.instance.error("Error info could not be extracted from following response: " + response.to_s)
|
62
|
+
end
|
63
|
+
|
55
64
|
# normalize it for display
|
56
65
|
error_msg = error_msg.empty? ? DefaultErrorMsg : "#{error_msg}"
|
57
66
|
|
58
67
|
unless error_code and SpecificErrorCodes.include?(error_code)
|
59
|
-
error_code =
|
68
|
+
error_code =
|
60
69
|
if error_internal
|
61
70
|
error_on_server ? :server_error : :client_error
|
62
71
|
else
|
63
72
|
DefaultErrorCode
|
64
73
|
end
|
65
74
|
end
|
66
|
-
|
75
|
+
|
67
76
|
error_code = error_code.to_sym
|
68
77
|
Info.new(error_msg,error_code,error_backtrace)
|
69
78
|
end
|
@@ -74,4 +83,4 @@ module DTK; module Client
|
|
74
83
|
|
75
84
|
end
|
76
85
|
end
|
77
|
-
end; end
|
86
|
+
end; end
|
data/lib/domain/response.rb
CHANGED
data/lib/dtk-client/version.rb
CHANGED
data/lib/dtk_client.rb
CHANGED
@@ -28,4 +28,4 @@ require File.expand_path('../commands/thor/account', __FILE__)
|
|
28
28
|
require File.expand_path('../shell/parse_monkey_patch', __FILE__)
|
29
29
|
require File.expand_path('../shell/help_monkey_patch', __FILE__)
|
30
30
|
require File.expand_path('../execute/cli_pure/cli_rerouter', __FILE__)
|
31
|
-
require File.expand_path('../context_router', __FILE__)
|
31
|
+
require File.expand_path('../context_router', __FILE__)
|
data/lib/dtk_constants.rb
CHANGED
data/lib/dtk_error.rb
CHANGED
data/lib/dtk_logger.rb
CHANGED
@@ -15,99 +15,99 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
|
-
##
|
19
|
-
# DtkLogger singleton to be used for logging.
|
20
|
-
#
|
21
|
-
require 'singleton'
|
22
|
-
require 'logger'
|
23
|
-
require 'colorize'
|
24
|
-
require 'pp'
|
25
|
-
|
26
|
-
require File.expand_path('./util/os_util', File.dirname(__FILE__))
|
27
|
-
|
28
|
-
class DtkLogger
|
29
|
-
|
30
|
-
#
|
31
|
-
LOG_FILE_NAME = 'client.log'
|
32
|
-
LOG_MB_SIZE = 2
|
33
|
-
LOG_NUMBER_OF_OLD_FILES = 10
|
34
|
-
DEVELOPMENT_MODE = DTK::Configuration.get(:development_mode)
|
35
|
-
|
36
|
-
include Singleton
|
37
|
-
|
38
|
-
def initialize
|
39
|
-
log_location_dir = DTK::Client::OsUtil.get_log_location()
|
40
|
-
begin
|
41
|
-
if File.directory?(log_location_dir)
|
42
|
-
file = File.open(file_path(), "a")
|
43
|
-
file.sync = true
|
44
|
-
@logger = Logger.new(file, LOG_NUMBER_OF_OLD_FILES, LOG_MB_SIZE * 1024000)
|
45
|
-
|
46
|
-
@logger.formatter = proc do |severity, datetime, progname, msg|
|
47
|
-
"[#{datetime}] #{severity} -- : #{msg}\n"
|
48
|
-
end
|
49
|
-
else
|
50
|
-
no_log_dir(log_location_dir)
|
51
|
-
end
|
52
|
-
rescue Errno::EACCES
|
53
|
-
no_log_permissions(log_location_dir)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def file_path()
|
58
|
-
"#{DTK::Client::OsUtil.get_log_location()}/#{LOG_FILE_NAME}"
|
59
|
-
end
|
60
|
-
|
61
|
-
def debug(log_text, sttdout_out=false)
|
62
|
-
puts log_text if sttdout_out || DEVELOPMENT_MODE
|
63
|
-
@logger.debug(log_text) if log_created?
|
64
|
-
end
|
65
|
-
|
66
|
-
def info(log_text, sttdout_out=false)
|
67
|
-
puts log_text if sttdout_out || DEVELOPMENT_MODE
|
68
|
-
@logger.info(log_text) if log_created?
|
69
|
-
end
|
70
|
-
|
71
|
-
def warn(log_text, sttdout_out=false)
|
72
|
-
DTK::Client::OsUtil.print(log_text, :yellow) if sttdout_out || DEVELOPMENT_MODE
|
73
|
-
@logger.warn(log_text) if log_created?
|
74
|
-
end
|
75
|
-
|
76
|
-
def error(log_text, sttdout_out=false)
|
77
|
-
DTK::Client::OsUtil.print(log_text, :red) if sttdout_out || DEVELOPMENT_MODE
|
78
|
-
@logger.error(log_text) if log_created?
|
79
|
-
end
|
80
|
-
|
81
|
-
def error_pp(message, backtrace, sttdout_out = true)
|
82
|
-
error(message, sttdout_out)
|
83
|
-
# we do not print this to STDOUT (will be overriden with DEVELOPMENT_MODE)s
|
84
|
-
error("#{message}\n" + PP.pp(backtrace, ""), false) if backtrace
|
85
|
-
end
|
86
|
-
|
87
|
-
def fatal_pp(message, backtrace, sttdout_out = true)
|
88
|
-
fatal(message, sttdout_out)
|
89
|
-
# we do not print this to STDOUT (will be overriden with DEVELOPMENT_MODE)
|
90
|
-
fatal("#{message}\n" + PP.pp(backtrace, ""), false) if backtrace
|
91
|
-
end
|
92
|
-
|
93
|
-
|
94
|
-
def fatal(log_text, sttdout_out=false)
|
95
|
-
puts log_text if sttdout_out || DEVELOPMENT_MODE
|
96
|
-
@logger.fatal(log_text) if log_created?
|
97
|
-
end
|
98
|
-
|
99
|
-
private
|
100
|
-
|
101
|
-
def log_created?
|
102
|
-
#no log found if @logger.nil?
|
103
|
-
return !@logger.nil?
|
104
|
-
end
|
105
|
-
|
106
|
-
def no_log_dir(dir)
|
107
|
-
puts "[WARNING] Log directory (#{dir}) does not exist; please add it manually or re-install DTK client."
|
108
|
-
end
|
109
|
-
|
110
|
-
def no_log_permissions(dir)
|
111
|
-
puts "[WARNING] User (#{DTK::Common::Aux.running_process_user()}) does not have permissions to create a log file in log directory (#{dir})"
|
112
|
-
end
|
113
|
-
end
|
18
|
+
##
|
19
|
+
# DtkLogger singleton to be used for logging.
|
20
|
+
#
|
21
|
+
require 'singleton'
|
22
|
+
require 'logger'
|
23
|
+
require 'colorize'
|
24
|
+
require 'pp'
|
25
|
+
|
26
|
+
require File.expand_path('./util/os_util', File.dirname(__FILE__))
|
27
|
+
|
28
|
+
class DtkLogger
|
29
|
+
|
30
|
+
#
|
31
|
+
LOG_FILE_NAME = 'client.log'
|
32
|
+
LOG_MB_SIZE = 2
|
33
|
+
LOG_NUMBER_OF_OLD_FILES = 10
|
34
|
+
DEVELOPMENT_MODE = DTK::Configuration.get(:development_mode)
|
35
|
+
|
36
|
+
include Singleton
|
37
|
+
|
38
|
+
def initialize
|
39
|
+
log_location_dir = DTK::Client::OsUtil.get_log_location()
|
40
|
+
begin
|
41
|
+
if File.directory?(log_location_dir)
|
42
|
+
file = File.open(file_path(), "a")
|
43
|
+
file.sync = true
|
44
|
+
@logger = Logger.new(file, LOG_NUMBER_OF_OLD_FILES, LOG_MB_SIZE * 1024000)
|
45
|
+
|
46
|
+
@logger.formatter = proc do |severity, datetime, progname, msg|
|
47
|
+
"[#{datetime}] #{severity} -- : #{msg}\n"
|
48
|
+
end
|
49
|
+
else
|
50
|
+
no_log_dir(log_location_dir)
|
51
|
+
end
|
52
|
+
rescue Errno::EACCES
|
53
|
+
no_log_permissions(log_location_dir)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def file_path()
|
58
|
+
"#{DTK::Client::OsUtil.get_log_location()}/#{LOG_FILE_NAME}"
|
59
|
+
end
|
60
|
+
|
61
|
+
def debug(log_text, sttdout_out=false)
|
62
|
+
puts log_text if sttdout_out || DEVELOPMENT_MODE
|
63
|
+
@logger.debug(log_text) if log_created?
|
64
|
+
end
|
65
|
+
|
66
|
+
def info(log_text, sttdout_out=false)
|
67
|
+
puts log_text if sttdout_out || DEVELOPMENT_MODE
|
68
|
+
@logger.info(log_text) if log_created?
|
69
|
+
end
|
70
|
+
|
71
|
+
def warn(log_text, sttdout_out=false)
|
72
|
+
DTK::Client::OsUtil.print(log_text, :yellow) if sttdout_out || DEVELOPMENT_MODE
|
73
|
+
@logger.warn(log_text) if log_created?
|
74
|
+
end
|
75
|
+
|
76
|
+
def error(log_text, sttdout_out=false)
|
77
|
+
DTK::Client::OsUtil.print(log_text, :red) if sttdout_out || DEVELOPMENT_MODE
|
78
|
+
@logger.error(log_text) if log_created?
|
79
|
+
end
|
80
|
+
|
81
|
+
def error_pp(message, backtrace, sttdout_out = true)
|
82
|
+
error(message, sttdout_out)
|
83
|
+
# we do not print this to STDOUT (will be overriden with DEVELOPMENT_MODE)s
|
84
|
+
error("#{message}\n" + PP.pp(backtrace, ""), false) if backtrace
|
85
|
+
end
|
86
|
+
|
87
|
+
def fatal_pp(message, backtrace, sttdout_out = true)
|
88
|
+
fatal(message, sttdout_out)
|
89
|
+
# we do not print this to STDOUT (will be overriden with DEVELOPMENT_MODE)
|
90
|
+
fatal("#{message}\n" + PP.pp(backtrace, ""), false) if backtrace
|
91
|
+
end
|
92
|
+
|
93
|
+
|
94
|
+
def fatal(log_text, sttdout_out=false)
|
95
|
+
puts log_text if sttdout_out || DEVELOPMENT_MODE
|
96
|
+
@logger.fatal(log_text) if log_created?
|
97
|
+
end
|
98
|
+
|
99
|
+
private
|
100
|
+
|
101
|
+
def log_created?
|
102
|
+
#no log found if @logger.nil?
|
103
|
+
return !@logger.nil?
|
104
|
+
end
|
105
|
+
|
106
|
+
def no_log_dir(dir)
|
107
|
+
puts "[WARNING] Log directory (#{dir}) does not exist; please add it manually or re-install DTK client."
|
108
|
+
end
|
109
|
+
|
110
|
+
def no_log_permissions(dir)
|
111
|
+
puts "[WARNING] User (#{DTK::Common::Aux.running_process_user()}) does not have permissions to create a log file in log directory (#{dir})"
|
112
|
+
end
|
113
|
+
end
|
data/lib/error.rb
CHANGED
data/lib/execute/command.rb
CHANGED
data/lib/execute/script.rb
CHANGED
data/lib/execute.rb
CHANGED
data/lib/parser/adapters/thor.rb
CHANGED