choria-mcorpc-support 2.20.3 → 2.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mcollective.rb +18 -19
- data/lib/mcollective/agent.rb +0 -1
- data/lib/mcollective/agents.rb +17 -18
- data/lib/mcollective/aggregate.rb +11 -11
- data/lib/mcollective/application.rb +30 -41
- data/lib/mcollective/applications.rb +13 -14
- data/lib/mcollective/cache.rb +1 -1
- data/lib/mcollective/client.rb +25 -25
- data/lib/mcollective/config.rb +114 -120
- data/lib/mcollective/data.rb +9 -9
- data/lib/mcollective/ddl.rb +1 -1
- data/lib/mcollective/discovery.rb +13 -13
- data/lib/mcollective/exceptions.rb +17 -17
- data/lib/mcollective/facts.rb +2 -2
- data/lib/mcollective/log.rb +7 -9
- data/lib/mcollective/matcher.rb +28 -32
- data/lib/mcollective/message.rb +31 -29
- data/lib/mcollective/monkey_patches.rb +92 -83
- data/lib/mcollective/optionparser.rb +23 -23
- data/lib/mcollective/pluginmanager.rb +8 -11
- data/lib/mcollective/pluginpackager.rb +13 -17
- data/lib/mcollective/rpc.rb +16 -18
- data/lib/mcollective/runnerstats.rb +10 -6
- data/lib/mcollective/shell.rb +30 -33
- data/lib/mcollective/ssl.rb +9 -12
- data/lib/mcollective/util.rb +160 -135
- data/lib/mcollective/validator.rb +18 -20
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3f6b0f73405083156308dae503d0498332bc81c
|
4
|
+
data.tar.gz: 7c780d21ec775ddbc5b17640682be709a343c94b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70b7fb634326c07bf3940692641a4e66b734d2388647186d25080025f019c66ad39b07f4b7d60b90e6a8da7171f6f6dbfbb7f5f79aced3e146149f5cc94828be
|
7
|
+
data.tar.gz: de2c15f4c16831773119ce0c167d3a17f9b55aa9f3546e0a90b017353879b74b198fd50b65839f251d387c93f3247faf81941bd54c7de4c85958953038da8b8c
|
data/lib/mcollective.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
13
|
-
require
|
14
|
-
require
|
15
|
-
require
|
16
|
-
require
|
17
|
-
require
|
1
|
+
require "rubygems"
|
2
|
+
require "json"
|
3
|
+
require "timeout"
|
4
|
+
require "digest/md5"
|
5
|
+
require "optparse"
|
6
|
+
require "singleton"
|
7
|
+
require "socket"
|
8
|
+
require "erb"
|
9
|
+
require "shellwords"
|
10
|
+
require "stringio"
|
11
|
+
require "rbconfig"
|
12
|
+
require "tempfile"
|
13
|
+
require "tmpdir"
|
14
|
+
require "mcollective/monkey_patches"
|
15
|
+
require "mcollective/cache"
|
16
|
+
require "mcollective/exceptions"
|
17
|
+
require "systemu"
|
18
18
|
|
19
19
|
# == The Marionette Collective
|
20
20
|
#
|
@@ -26,7 +26,6 @@ require 'systemu'
|
|
26
26
|
# For an overview of the idea behind this and what it enables please see:
|
27
27
|
# http://www.devco.net/archives/2009/10/18/middleware_for_systems_administration.php
|
28
28
|
module MCollective
|
29
|
-
|
30
29
|
require "mcollective/agent"
|
31
30
|
require "mcollective/agents"
|
32
31
|
require "mcollective/aggregate"
|
@@ -55,7 +54,7 @@ module MCollective
|
|
55
54
|
require "mcollective/util"
|
56
55
|
require "mcollective/validator"
|
57
56
|
|
58
|
-
VERSION="2.20.
|
57
|
+
VERSION = "2.20.4".freeze
|
59
58
|
|
60
59
|
def self.version
|
61
60
|
VERSION
|
data/lib/mcollective/agent.rb
CHANGED
data/lib/mcollective/agents.rb
CHANGED
@@ -2,11 +2,11 @@ module MCollective
|
|
2
2
|
# A collection of agents, loads them, reloads them and dispatches messages to them.
|
3
3
|
# It uses the PluginManager to store, load and manage instances of plugins.
|
4
4
|
class Agents
|
5
|
-
def initialize(agents
|
5
|
+
def initialize(agents={})
|
6
6
|
@config = Config.instance
|
7
|
-
raise
|
7
|
+
raise "Configuration has not been loaded, can't load agents" unless @config.configured
|
8
8
|
|
9
|
-
@@agents = agents
|
9
|
+
@@agents = agents # rubocop:disable Style/ClassVars
|
10
10
|
|
11
11
|
loadagents
|
12
12
|
end
|
@@ -18,7 +18,7 @@ module MCollective
|
|
18
18
|
Util.unsubscribe(Util.make_subscriptions(agent, :broadcast))
|
19
19
|
end
|
20
20
|
|
21
|
-
@@agents = {}
|
21
|
+
@@agents = {} # rubocop:disable Style/ClassVars
|
22
22
|
end
|
23
23
|
|
24
24
|
# Loads all agents from disk
|
@@ -67,9 +67,10 @@ module MCollective
|
|
67
67
|
Log.debug("Not activating agent #{agentname} due to agent policy in activate? method")
|
68
68
|
return false
|
69
69
|
end
|
70
|
-
rescue Exception
|
71
|
-
Log.error("Loading agent
|
72
|
-
PluginManager.delete("
|
70
|
+
rescue Exception # rubocop:disable Lint/RescueException
|
71
|
+
Log.error("Loading agent %s failed: %s" % [agentname, $!])
|
72
|
+
PluginManager.delete("%s_agent" % agentname)
|
73
|
+
|
73
74
|
return false
|
74
75
|
end
|
75
76
|
end
|
@@ -91,8 +92,8 @@ module MCollective
|
|
91
92
|
Log.debug("#{klass} does not have an activate? method, activating as default")
|
92
93
|
return true
|
93
94
|
end
|
94
|
-
rescue Exception
|
95
|
-
Log.warn("Agent activation check for #{agent} failed:
|
95
|
+
rescue Exception # rubocop:disable Lint/RescueException
|
96
|
+
Log.warn("Agent activation check for %s #{agent} failed: %s: %s" % [agent, $!.class, $!])
|
96
97
|
return false
|
97
98
|
end
|
98
99
|
|
@@ -105,7 +106,7 @@ module MCollective
|
|
105
106
|
return agentfile
|
106
107
|
end
|
107
108
|
end
|
108
|
-
|
109
|
+
false
|
109
110
|
end
|
110
111
|
|
111
112
|
# Determines if we have an agent with a certain name
|
@@ -122,20 +123,18 @@ module MCollective
|
|
122
123
|
begin
|
123
124
|
agent = PluginManager["#{request.agent}_agent"]
|
124
125
|
|
125
|
-
Timeout
|
126
|
+
Timeout.timeout(agent.timeout) do
|
126
127
|
replies = agent.handlemsg(request.payload, connection)
|
127
128
|
|
128
129
|
# Agents can decide if they wish to reply or not,
|
129
130
|
# returning nil will mean nothing goes back to the
|
130
131
|
# requestor
|
131
|
-
unless replies
|
132
|
-
yield(replies)
|
133
|
-
end
|
132
|
+
yield(replies) unless replies.nil?
|
134
133
|
end
|
135
|
-
rescue Timeout::Error
|
136
|
-
Log.warn("Timeout while handling message for
|
137
|
-
rescue Exception
|
138
|
-
Log.error("Execution of
|
134
|
+
rescue Timeout::Error
|
135
|
+
Log.warn("Timeout while handling message for %s" % request.agent)
|
136
|
+
rescue Exception # rubocop:disable Lint/RescueException
|
137
|
+
Log.error("Execution of %s failed: %s" % [request.agent, $!])
|
139
138
|
Log.error(e.backtrace.join("\n\t\t"))
|
140
139
|
end
|
141
140
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module MCollective
|
2
2
|
class Aggregate
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "mcollective/aggregate/result"
|
4
|
+
require "mcollective/aggregate/base"
|
5
5
|
|
6
6
|
attr_accessor :ddl, :functions, :action, :failed
|
7
7
|
|
@@ -17,7 +17,7 @@ module MCollective
|
|
17
17
|
# Creates instances of the Aggregate functions and stores them in the function array.
|
18
18
|
# All aggregate call and summarize method calls operate on these function as a batch.
|
19
19
|
def create_functions
|
20
|
-
@ddl[:aggregate].each_with_index do |agg,
|
20
|
+
@ddl[:aggregate].each_with_index do |agg, _i|
|
21
21
|
output = agg[:args][0]
|
22
22
|
|
23
23
|
if contains_output?(output)
|
@@ -26,11 +26,11 @@ module MCollective
|
|
26
26
|
begin
|
27
27
|
@functions << load_function(agg[:function]).new(output, arguments, format, @action)
|
28
28
|
rescue Exception => e
|
29
|
-
Log.error("Cannot create aggregate function '
|
29
|
+
Log.error("Cannot create aggregate function '%s': %s" % [output, e])
|
30
30
|
@failed << {:name => output, :type => :startup}
|
31
31
|
end
|
32
32
|
else
|
33
|
-
Log.error("Cannot create aggregate function '
|
33
|
+
Log.error("Cannot create aggregate function '%s'. '%s' has not been specified as a valid ddl output." % [output, output])
|
34
34
|
@failed << {:name => output, :type => :create}
|
35
35
|
end
|
36
36
|
end
|
@@ -44,11 +44,11 @@ module MCollective
|
|
44
44
|
# Call all the appropriate functions with the reply data received from RPC::Client
|
45
45
|
def call_functions(reply)
|
46
46
|
@functions.each do |function|
|
47
|
-
Log.debug("Calling aggregate function
|
47
|
+
Log.debug("Calling aggregate function %s for result" % function)
|
48
48
|
begin
|
49
49
|
function.process_result(reply[:data][function.output_name], reply)
|
50
50
|
rescue Exception => e
|
51
|
-
Log.error("Could not process aggregate function for '
|
51
|
+
Log.error("Could not process aggregate function for '%s': %s" % [function.output_name, e])
|
52
52
|
@failed << {:name => function.output_name, :type => :process_result}
|
53
53
|
@functions.delete(function)
|
54
54
|
end
|
@@ -61,13 +61,13 @@ module MCollective
|
|
61
61
|
begin
|
62
62
|
function.summarize
|
63
63
|
rescue Exception => e
|
64
|
-
Log.error("Could not summarize aggregate result for '
|
64
|
+
Log.error("Could not summarize aggregate result for '%s': %s" % [function.output_name, e])
|
65
65
|
@failed << {:name => function.output_name, :type => :summarize}
|
66
66
|
nil
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
-
summary.reject
|
70
|
+
summary.reject(&:nil?).sort do |x, y|
|
71
71
|
x.result[:output] <=> y.result[:output]
|
72
72
|
end
|
73
73
|
end
|
@@ -76,10 +76,10 @@ module MCollective
|
|
76
76
|
def load_function(function_name)
|
77
77
|
function_name = function_name.to_s.capitalize
|
78
78
|
|
79
|
-
PluginManager.loadclass("MCollective::Aggregate
|
79
|
+
PluginManager.loadclass("MCollective::Aggregate::%s" % function_name) unless Aggregate.const_defined?(function_name)
|
80
80
|
Aggregate.const_get(function_name)
|
81
81
|
rescue Exception
|
82
|
-
raise
|
82
|
+
raise("Aggregate function file '%s.rb' cannot be loaded" % function_name.downcase)
|
83
83
|
end
|
84
84
|
end
|
85
85
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "mcollective/rpc"
|
2
2
|
|
3
3
|
module MCollective
|
4
4
|
class Application
|
@@ -70,9 +70,9 @@ module MCollective
|
|
70
70
|
:arguments => [],
|
71
71
|
:type => String,
|
72
72
|
:required => false,
|
73
|
-
:validate =>
|
73
|
+
:validate => proc { true }}
|
74
74
|
|
75
|
-
arguments.each_pair{|k,v| opt[k] = v}
|
75
|
+
arguments.each_pair {|k, v| opt[k] = v}
|
76
76
|
|
77
77
|
self[:cli_arguments] << opt
|
78
78
|
end
|
@@ -93,9 +93,7 @@ module MCollective
|
|
93
93
|
end
|
94
94
|
|
95
95
|
# The active options hash used for MC::Client and other configuration
|
96
|
-
|
97
|
-
@options
|
98
|
-
end
|
96
|
+
attr_reader :options
|
99
97
|
|
100
98
|
# Calls the supplied block in an option for validation, an error raised
|
101
99
|
# will log to STDERR and exit the application
|
@@ -113,12 +111,10 @@ module MCollective
|
|
113
111
|
def clioptions(help)
|
114
112
|
oparser = Optionparser.new({:verbose => false, :progress_bar => true}, "filter", application_options[:exclude_arg_sections])
|
115
113
|
|
116
|
-
options = oparser.parse do |parser,
|
117
|
-
if block_given?
|
118
|
-
yield(parser, options)
|
119
|
-
end
|
114
|
+
options = oparser.parse do |parser, opts|
|
115
|
+
yield(parser, opts) if block_given?
|
120
116
|
|
121
|
-
RPC::Helpers.add_simplerpc_options(parser,
|
117
|
+
RPC::Helpers.add_simplerpc_options(parser, opts) unless application_options[:exclude_arg_sections].include?("rpc")
|
122
118
|
end
|
123
119
|
|
124
120
|
return oparser.parser.help if help
|
@@ -128,8 +124,8 @@ module MCollective
|
|
128
124
|
post_option_parser(configuration) if respond_to?(:post_option_parser)
|
129
125
|
|
130
126
|
return options
|
131
|
-
rescue Exception
|
132
|
-
application_failure(
|
127
|
+
rescue Exception # rubocop:disable Lint/RescueException
|
128
|
+
application_failure($!)
|
133
129
|
end
|
134
130
|
|
135
131
|
# Builds an ObjectParser config, parse the CLI options and validates based
|
@@ -137,7 +133,7 @@ module MCollective
|
|
137
133
|
def application_parse_options(help=false)
|
138
134
|
@options ||= {:verbose => false}
|
139
135
|
|
140
|
-
@options = clioptions(help) do |parser,
|
136
|
+
@options = clioptions(help) do |parser, _options|
|
141
137
|
parser.define_head application_description if application_description
|
142
138
|
parser.banner = ""
|
143
139
|
|
@@ -156,16 +152,13 @@ module MCollective
|
|
156
152
|
parser.define_tail ""
|
157
153
|
parser.define_tail "The Marionette Collective #{MCollective.version}"
|
158
154
|
|
159
|
-
|
160
155
|
application_cli_arguments.each do |carg|
|
161
156
|
opts_array = []
|
162
157
|
|
163
158
|
opts_array << :on
|
164
159
|
|
165
160
|
# if a default is set from the application set it up front
|
166
|
-
if carg.include?(:default)
|
167
|
-
configuration[carg[:name]] = carg[:default]
|
168
|
-
end
|
161
|
+
configuration[carg[:name]] = carg[:default] if carg.include?(:default)
|
169
162
|
|
170
163
|
# :arguments are multiple possible ones
|
171
164
|
if carg[:arguments].is_a?(Array)
|
@@ -211,11 +204,10 @@ module MCollective
|
|
211
204
|
validation_passed = true
|
212
205
|
application_cli_arguments.each do |carg|
|
213
206
|
# Check for required arguments
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
end
|
207
|
+
next unless carg[:required]
|
208
|
+
unless configuration[carg[:name]]
|
209
|
+
validation_passed = false
|
210
|
+
STDERR.puts "The #{carg[:name]} option is mandatory"
|
219
211
|
end
|
220
212
|
end
|
221
213
|
|
@@ -223,8 +215,6 @@ module MCollective
|
|
223
215
|
STDERR.puts "\nPlease run with --help for detailed help"
|
224
216
|
exit 1
|
225
217
|
end
|
226
|
-
|
227
|
-
|
228
218
|
end
|
229
219
|
|
230
220
|
# Retrieves the full hash of application options
|
@@ -260,15 +250,15 @@ module MCollective
|
|
260
250
|
end
|
261
251
|
|
262
252
|
if options[:verbose]
|
263
|
-
err_dest.puts "\nThe %s application failed to run: %s\n" % [
|
253
|
+
err_dest.puts "\nThe %s application failed to run: %s\n" % [Util.colorize(:bold, $0), Util.colorize(:red, e.to_s)]
|
264
254
|
else
|
265
|
-
err_dest.puts "\nThe %s application failed to run, use -v for full error backtrace details: %s\n" % [
|
255
|
+
err_dest.puts "\nThe %s application failed to run, use -v for full error backtrace details: %s\n" % [Util.colorize(:bold, $0), Util.colorize(:red, e.to_s)]
|
266
256
|
end
|
267
257
|
|
268
258
|
if options.nil? || options[:verbose]
|
269
259
|
e.backtrace.first << Util.colorize(:red, " <----")
|
270
|
-
err_dest.puts "\n%s %s" % [
|
271
|
-
e.backtrace.each{|l| err_dest.puts "\tfrom #{l}"}
|
260
|
+
err_dest.puts "\n%s %s" % [Util.colorize(:red, e.to_s), Util.colorize(:bold, "(#{e.class})")]
|
261
|
+
e.backtrace.each {|l| err_dest.puts "\tfrom #{l}"}
|
272
262
|
end
|
273
263
|
|
274
264
|
disconnect
|
@@ -293,14 +283,13 @@ module MCollective
|
|
293
283
|
main
|
294
284
|
|
295
285
|
disconnect
|
296
|
-
|
297
|
-
|
298
|
-
application_failure(e)
|
286
|
+
rescue Exception # rubocop:disable Lint/RescueException
|
287
|
+
application_failure($!)
|
299
288
|
end
|
300
289
|
|
301
290
|
def disconnect
|
302
291
|
MCollective::PluginManager["connector_plugin"].disconnect
|
303
|
-
rescue
|
292
|
+
rescue # rubocop:disable Lint/HandleExceptions
|
304
293
|
end
|
305
294
|
|
306
295
|
# Fake abstract class that logs if the user tries to use an application without
|
@@ -316,27 +305,27 @@ module MCollective
|
|
316
305
|
:okcount => 0,
|
317
306
|
:failcount => 0}.merge(stats.to_hash)
|
318
307
|
|
319
|
-
if
|
308
|
+
if request_stats[:discoverytime] == 0 && request_stats[:responses] == 0
|
320
309
|
return 4
|
321
310
|
end
|
322
311
|
|
323
|
-
if
|
324
|
-
if
|
312
|
+
if request_stats[:discovered] > 0
|
313
|
+
if request_stats[:responses] == 0
|
325
314
|
return 3
|
326
|
-
elsif
|
315
|
+
elsif request_stats[:failcount] > 0
|
327
316
|
return 2
|
328
317
|
end
|
329
318
|
end
|
330
319
|
|
331
|
-
if
|
332
|
-
if
|
320
|
+
if request_stats[:discovered] == 0
|
321
|
+
if request_stats[:responses] && request_stats[:responses] > 0
|
333
322
|
return 0
|
334
323
|
else
|
335
324
|
return 1
|
336
325
|
end
|
337
326
|
end
|
338
327
|
|
339
|
-
|
328
|
+
0
|
340
329
|
end
|
341
330
|
|
342
331
|
# A helper that creates a consistent exit code for applications by looking at an
|
@@ -355,7 +344,7 @@ module MCollective
|
|
355
344
|
# Wrapper around MC::RPC#rpcclient that forcably supplies our options hash
|
356
345
|
# if someone forgets to pass in options in an application the filters and other
|
357
346
|
# cli options wouldnt take effect which could have a disasterous outcome
|
358
|
-
def rpcclient(agent, flags
|
347
|
+
def rpcclient(agent, flags={})
|
359
348
|
flags[:options] = options unless flags.include?(:options)
|
360
349
|
flags[:exit_on_failure] = false
|
361
350
|
|
@@ -10,17 +10,17 @@ module MCollective
|
|
10
10
|
|
11
11
|
begin
|
12
12
|
load_application(appname)
|
13
|
-
rescue Exception
|
13
|
+
rescue Exception # rubocop:disable Lint/RescueException
|
14
14
|
e.backtrace.first << Util.colorize(:red, " <----")
|
15
|
-
STDERR.puts "Application '
|
15
|
+
STDERR.puts "Application '%s' failed to load:" % appname
|
16
16
|
STDERR.puts
|
17
|
-
STDERR.puts Util.colorize(:red, "
|
17
|
+
STDERR.puts Util.colorize(:red, " %s (%s)" % [$!, $!.class])
|
18
18
|
STDERR.puts
|
19
|
-
STDERR.puts " %s" % [
|
19
|
+
STDERR.puts " %s" % [$!.backtrace.join("\n ")]
|
20
20
|
exit 1
|
21
21
|
end
|
22
22
|
|
23
|
-
PluginManager["
|
23
|
+
PluginManager["%s_application" % appname].run
|
24
24
|
end
|
25
25
|
|
26
26
|
def self.load_application(appname)
|
@@ -39,17 +39,16 @@ module MCollective
|
|
39
39
|
PluginManager.find("application")
|
40
40
|
rescue SystemExit
|
41
41
|
exit 1
|
42
|
-
rescue Exception
|
43
|
-
STDERR.puts
|
42
|
+
rescue Exception # rubocop:disable Lint/RescueException
|
43
|
+
STDERR.puts("Failed to generate application list: %s: %s" % [$!.class, $!])
|
44
44
|
exit 1
|
45
45
|
end
|
46
46
|
|
47
47
|
# Filters a string of opts out using Shellwords
|
48
48
|
# keeping only things related to --config and -c
|
49
49
|
def self.filter_extra_options(opts)
|
50
|
-
res = ""
|
51
50
|
words = Shellwords.shellwords(opts)
|
52
|
-
words.each_with_index do |word,idx|
|
51
|
+
words.each_with_index do |word, idx|
|
53
52
|
if word == "-c"
|
54
53
|
return "--config=#{words[idx + 1]}"
|
55
54
|
elsif word == "--config"
|
@@ -61,7 +60,7 @@ module MCollective
|
|
61
60
|
end
|
62
61
|
end
|
63
62
|
|
64
|
-
|
63
|
+
""
|
65
64
|
end
|
66
65
|
|
67
66
|
# We need to know the config file in order to know the libdir
|
@@ -110,8 +109,8 @@ module MCollective
|
|
110
109
|
# am done with it
|
111
110
|
ENV["MCOLLECTIVE_EXTRA_OPTS"] = filter_extra_options(ENV["MCOLLECTIVE_EXTRA_OPTS"].clone)
|
112
111
|
parser.environment("MCOLLECTIVE_EXTRA_OPTS")
|
113
|
-
rescue Exception
|
114
|
-
Log.error("Failed to parse MCOLLECTIVE_EXTRA_OPTS:
|
112
|
+
rescue Exception # rubocop:disable Lint/RescueException
|
113
|
+
Log.error("Failed to parse MCOLLECTIVE_EXTRA_OPTS: %s" % $!)
|
115
114
|
end
|
116
115
|
|
117
116
|
ENV["MCOLLECTIVE_EXTRA_OPTS"] = original_extra_opts.clone
|
@@ -119,14 +118,14 @@ module MCollective
|
|
119
118
|
|
120
119
|
begin
|
121
120
|
parser.parse!
|
122
|
-
rescue OptionParser::InvalidOption
|
121
|
+
rescue OptionParser::InvalidOption
|
123
122
|
retry
|
124
123
|
end
|
125
124
|
|
126
125
|
ARGV.clear
|
127
126
|
original_argv.each {|a| ARGV << a}
|
128
127
|
|
129
|
-
configfile
|
128
|
+
configfile ||= Util.config_file_for_user
|
130
129
|
|
131
130
|
Config.instance.loadconfig(configfile)
|
132
131
|
end
|