Revision 24b3b9d6 src/ipamm_mad/one_ipam.rb

View differences:

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

  

Also available in: Unified diff