Revision 24b3b9d6

View differences:

src/authm_mad/one_auth_mad.rb
52 52
    #        built-in ACL engine
53 53
    # @param [Array] authentication modules enabled, nil will use any
54 54
    #        any method existing in remotes directory
55
    def initialize(authZ, authN, nthreads)
55
    # @param [Numeric] number of threads
56
    # @param [Hash] extra options
57
    def initialize(authZ, authN, nthreads, options = {})
56 58
        super(
57 59
            "auth",
58
            :concurrency   => nthreads,
59
            :threaded      => nthreads > 0,
60
            :local_actions => {ACTION[:authN] => nil, ACTION[:authZ] => nil}
60
            options.merge({
61
                :concurrency   => nthreads,
62
                :threaded      => nthreads > 0,
63
                :local_actions => {
64
                    ACTION[:authN] => nil,
65
                    ACTION[:authZ] => nil
66
                }
67
            })
61 68
        )
62 69

  
63 70
        register_action(ACTION[:authN].to_sym, method("authN"))
......
173 180
opts = GetoptLong.new(
174 181
    [ '--threads',    '-t', GetoptLong::REQUIRED_ARGUMENT ],
175 182
    [ '--authz',      '-z', GetoptLong::REQUIRED_ARGUMENT ],
176
    [ '--authn',      '-n', GetoptLong::REQUIRED_ARGUMENT ]
183
    [ '--authn',      '-n', GetoptLong::REQUIRED_ARGUMENT ],
184
    [ '--timeout',    '-w', GetoptLong::OPTIONAL_ARGUMENT ]
177 185
)
178 186

  
179 187
threads = 15
180 188
authz   = nil
181 189
authn   = nil
190
timeout = nil
182 191

  
183 192
begin
184 193
    opts.each do |opt, arg|
......
189 198
                authz   = arg
190 199
            when '--authn'
191 200
                authn   = arg.split(',').map {|a| a.strip }
201
            when '--timeout'
202
                timeout = arg
192 203
        end
193 204
    end
194 205
rescue Exception => e
195 206
    exit(-1)
196 207
end
197 208

  
198
auth_driver = AuthDriver.new(authz, authn, threads)
209
auth_driver = AuthDriver.new(authz, authn, threads,
210
                             :timeout => timeout)
199 211

  
200 212
auth_driver.start_driver
src/datastore_mad/one_datastore.rb
237 237
opts = GetoptLong.new(
238 238
    [ '--threads',         '-t', GetoptLong::OPTIONAL_ARGUMENT ],
239 239
    [ '--ds-types',        '-d', GetoptLong::OPTIONAL_ARGUMENT ],
240
    [ '--system-ds-types', '-s', GetoptLong::OPTIONAL_ARGUMENT ]
240
    [ '--system-ds-types', '-s', GetoptLong::OPTIONAL_ARGUMENT ],
241
    [ '--timeout',         '-w', GetoptLong::OPTIONAL_ARGUMENT ]
241 242
)
242 243

  
243 244
ds_type     = nil
244 245
sys_ds_type = nil
245 246
threads     = 15
247
timeout     = nil
246 248

  
247 249
begin
248 250
    opts.each do |opt, arg|
......
253 255
                ds_type = arg.split(',').map {|a| a.strip }
254 256
            when '--system-ds-types'
255 257
                sys_ds_type = arg.split(',').map {|a| a.strip }
258
            when '--timeout'
259
                timeout = arg
256 260
        end
257 261
    end
258 262
rescue Exception => e
259 263
    exit(-1)
260 264
end
261 265

  
262
ds_driver = DatastoreDriver.new(ds_type, sys_ds_type, :concurrency => threads)
266
ds_driver = DatastoreDriver.new(ds_type, sys_ds_type,
267
                                :concurrency    => threads,
268
                                :timeout        => timeout)
263 269
ds_driver.start_driver
src/im_mad/im_exec/one_im_exec.rb
109 109
    [ '--retries',    '-r', GetoptLong::OPTIONAL_ARGUMENT ],
110 110
    [ '--threads',    '-t', GetoptLong::OPTIONAL_ARGUMENT ],
111 111
    [ '--local',      '-l', GetoptLong::NO_ARGUMENT ],
112
    [ '--force-copy', '-c', GetoptLong::NO_ARGUMENT ]
112
    [ '--force-copy', '-c', GetoptLong::NO_ARGUMENT ],
113
    [ '--timeout',    '-w', GetoptLong::OPTIONAL_ARGUMENT ]
113 114
)
114 115

  
115 116
hypervisor      = ''
......
117 118
threads         = 15
118 119
local_actions   = {}
119 120
force_copy      = false
121
timeout         = nil
120 122

  
121 123
begin
122 124
    opts.each do |opt, arg|
......
129 131
                local_actions={ 'MONITOR' => nil }
130 132
            when '--force-copy'
131 133
                force_copy=true
134
            when '--timeout'
135
                timeout = arg
132 136
        end
133 137
    end
134 138
rescue Exception => e
......
140 144
end
141 145

  
142 146
im = InformationManagerDriver.new(hypervisor,
143
    :concurrency => threads,
144
    :retries => retries,
145
    :local_actions => local_actions,
146
    :force_copy => force_copy)
147
                                  :concurrency      => threads,
148
                                  :retries          => retries,
149
                                  :local_actions    => local_actions,
150
                                  :force_copy       => force_copy,
151
                                  :timeout          => timeout)
147 152

  
148 153
im.start_driver
src/ipamm_mad/one_ipam.rb
146 146
opts = GetoptLong.new(
147 147
    [ '--threads',    '-t', GetoptLong::OPTIONAL_ARGUMENT ],
148 148
    [ '--ipam-types', '-i', GetoptLong::REQUIRED_ARGUMENT ],
149
    [ '--timeout',    '-w', GetoptLong::OPTIONAL_ARGUMENT ]
149 150
)
150 151

  
151 152
i_types = nil
152 153
threads = 1
154
timeout = 1
153 155

  
154 156
begin
155 157
    opts.each do |opt, arg|
......
158 160
                i_types = arg.split(',').map {|a| a.strip }
159 161
            when '--threads'
160 162
                threads = arg.to_i
163
            when '--timeout'
164
                timeout = arg
161 165
        end
162 166
    end
163 167
rescue Exception => e
164 168
    exit(-1)
165 169
end
166 170

  
167
ipam_driver = IPAMDriver.new(i_types, :concurrency => threads)
171
ipam_driver = IPAMDriver.new(i_types,
172
                             :concurrency   => threads,
173
                             :timeout       => timeout)
168 174
ipam_driver.start_driver
169 175

  
src/market_mad/one_market.rb
281 281

  
282 282
opts = GetoptLong.new(
283 283
    [ '--threads',         '-t', GetoptLong::OPTIONAL_ARGUMENT ],
284
    [ '--market-types',    '-m', GetoptLong::OPTIONAL_ARGUMENT ]
284
    [ '--market-types',    '-m', GetoptLong::OPTIONAL_ARGUMENT ],
285
    [ '--timeout',         '-w', GetoptLong::OPTIONAL_ARGUMENT ]
285 286
)
286 287

  
287 288
mp_type = nil
288 289
threads = 15
290
timeout = nil
289 291

  
290 292
begin
291 293
    opts.each do |opt, arg|
......
294 296
                threads = arg.to_i
295 297
            when '--market-types'
296 298
                mp_type = arg.split(',').map {|a| a.strip }
299
            when '--timeout'
300
                timeout = arg
297 301
        end
298 302
    end
299 303
rescue Exception => e
300 304
    exit(-1)
301 305
end
302 306

  
303
mp_driver = MarketPlaceDriver.new(mp_type, :concurrency => threads)
307
mp_driver = MarketPlaceDriver.new(mp_type,
308
                                  :concurrency  => threads,
309
                                  :timeout      => timeout)
304 310
mp_driver.start_driver
305 311

  
src/tm_mad/one_tm.rb
148 148
if __FILE__ == $0
149 149
    opts = GetoptLong.new(
150 150
        [ '--threads',  '-t', GetoptLong::OPTIONAL_ARGUMENT ],
151
        [ '--tm-types', '-d', GetoptLong::OPTIONAL_ARGUMENT ]
151
        [ '--tm-types', '-d', GetoptLong::OPTIONAL_ARGUMENT ],
152
        [ '--timeout',  '-w', GetoptLong::OPTIONAL_ARGUMENT ]
152 153
    )
153 154

  
154 155
    tm_type = nil
155 156
    threads = 15
157
    timeout = 15
156 158

  
157 159
    begin
158 160
        opts.each do |opt, arg|
......
161 163
                    threads = arg.to_i
162 164
                when '--tm-types'
163 165
                    tm_type = arg.split(',').map {|a| a.strip }
166
                when '--timeout'
167
                    timeout = arg
164 168
            end
165 169
        end
166 170
    rescue Exception => e
167 171
        exit(-1)
168 172
    end
169 173

  
170
    tm_driver = TransferManagerDriver.new(tm_type, :concurrency => threads)
174
    tm_driver = TransferManagerDriver.new(tm_type,
175
                                          :concurrency  => threads,
176
                                          :timeout      => timeout)
171 177
    tm_driver.start_driver
172 178
end
src/vmm_mad/exec/one_vmm_exec.rb
1063 1063
    [ '--threads',           '-t', GetoptLong::OPTIONAL_ARGUMENT ],
1064 1064
    [ '--local',             '-l', GetoptLong::REQUIRED_ARGUMENT ],
1065 1065
    [ '--shell',             '-s', GetoptLong::REQUIRED_ARGUMENT ],
1066
    [ '--parallel',          '-p', GetoptLong::NO_ARGUMENT ]
1066
    [ '--parallel',          '-p', GetoptLong::NO_ARGUMENT ],
1067
    [ '--timeout',           '-w', GetoptLong::OPTIONAL_ARGUMENT ]
1067 1068
)
1068 1069

  
1069 1070
hypervisor         = ''
......
1072 1073
shell              = 'bash'
1073 1074
local_actions      = {}
1074 1075
single_host        = true
1076
timeout            = nil
1075 1077

  
1076 1078
begin
1077 1079
    opts.each do |opt, arg|
......
1086 1088
                shell = arg
1087 1089
            when '--parallel'
1088 1090
                single_host = false
1091
            when '--timeout'
1092
                timeout = arg
1089 1093
        end
1090 1094
    end
1091 1095
rescue Exception => e
......
1103 1107
                :retries            => retries,
1104 1108
                :local_actions      => local_actions,
1105 1109
                :shell              => shell,
1106
                :single_host        => single_host)
1110
                :single_host        => single_host,
1111
                :timeout            => timeout)
1107 1112

  
1108 1113
exec_driver.start_driver

Also available in: Unified diff