rest-ftp-daemon 0.304.0 → 0.305.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 879a66df142ffdef4e82af5932e0ae6f862382b1
4
- data.tar.gz: d81bb16f0c971a2b7a07e0902aa5ab40bce438e7
3
+ metadata.gz: c2802386f8b827e27d25b54c13cc87fd53eb2e1f
4
+ data.tar.gz: e7025e6844c9469ff02b1a1eb3c1bf204d6910c7
5
5
  SHA512:
6
- metadata.gz: e2fb79546eb167872017b0995e7c055fd26ffea32272c17403e4a278e4b13f63a6245c2e5bb277061a90c6eddef6ad72e7bb00cead8a9d312058213db8b3a8f2
7
- data.tar.gz: 39548d2cfbe17d534a4e03f7060399fbb8e8f06fce93a0190c86fe1360d9064b56bf8cb9c70cfc8e508fe19dd8af8e69107aecfbfab944e323cbd6a935f75471
6
+ metadata.gz: e9dff222b7810f70a7cba87452ef23e19c1d8dfac637e0dbe7ca3d6ec2a50bf7a6cabf2cd1da5f68a5de88b58b3abb694c6ff3ee79f9955f809bf5bb1d976e36
7
+ data.tar.gz: 9578b8b8521da9e393fed22a119caf8343bc9a9d5df56eae2e4b685a6f705b9d3033be38f340e6731e36e611c1783e5ea618cd5703a67cd5acd7c92adec28eeb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rest-ftp-daemon (0.304.0)
4
+ rest-ftp-daemon (0.305.0)
5
5
  api-auth
6
6
  bmc-daemon-lib (~> 0.2)
7
7
  double-bag-ftps
data/README.md CHANGED
@@ -234,6 +234,7 @@ transfer:
234
234
  notify_after: 5 # wait at least X seconds between HTTP notifications
235
235
 
236
236
  debug_ftp: false
237
+ debug_ftps: false
237
238
  debug_sftp: false
238
239
 
239
240
  retry_on: # job error values that will allow a retry
data/defaults.yml CHANGED
@@ -30,6 +30,7 @@ transfer:
30
30
  notify_after: 5 # wait at least X seconds between HTTP notifications
31
31
 
32
32
  debug_ftp: false
33
+ debug_ftps: false
33
34
  debug_sftp: false
34
35
 
35
36
  retry_on: # job error values that will allow a retry
@@ -3,6 +3,9 @@ require "grape"
3
3
  module RestFtpDaemon
4
4
  module API
5
5
  class Root < Grape::API
6
+ include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
7
+
8
+
6
9
 
7
10
  ### LOGGING & HELPERS
8
11
  helpers do
@@ -156,11 +156,20 @@ module RestFtpDaemon
156
156
  rescue OpenSSL::SSL::SSLError => exception
157
157
  return oops :ended, exception, "conn_openssl_error"
158
158
 
159
+ rescue Net::FTPReplyError => exception
160
+ return oops :ended, exception, "ftp_reply_error"
161
+
162
+ rescue Net::FTPTempError => exception
163
+ return oops :ended, exception, "ftp_temp_error"
164
+
159
165
  rescue Net::FTPPermError => exception
160
166
  return oops :ended, exception, "ftp_perm_error"
161
167
 
162
- rescue Net::FTPTempError => exception
163
- return oops :ended, exception, "net_temp_error"
168
+ rescue Net::FTPProtoError => exception
169
+ return oops :ended, exception, "ftp_proto_error"
170
+
171
+ rescue Net::FTPError => exception
172
+ return oops :ended, exception, "ftp_error"
164
173
 
165
174
  rescue Net::SFTP::StatusException => exception
166
175
  return oops :ended, exception, "sftp_exception"
@@ -313,30 +322,21 @@ module RestFtpDaemon
313
322
  set_info :target, :host, target_uri.host
314
323
  @target_path = Path.new target_uri.path, true
315
324
 
316
- #puts "@target_path: #{@target_path.inspect}"
317
-
318
- # Prepare remote
319
- #FIXME: use a "case" statement on @target_url.class
320
-
325
+ # Prepare remote (case would be preferable but too hard to use,
326
+ # as target could be of a descendent class of URI:XXX and not matching directlry)
321
327
  if target_uri.is_a? URI::FTP
322
328
  log_info "Job.prepare target_method FTP"
323
- # set_info :target, :method, :ftp
324
329
  set_info :target, :method, JOB_METHOD_FTP
325
- #@target_method = :ftp
326
330
  @remote = RemoteFTP.new target_uri, log_prefix, debug: @config[:debug_ftp]
327
331
 
328
332
  elsif (target_uri.is_a? URI::FTPES) || (target_uri.is_a? URI::FTPS)
329
333
  log_info "Job.prepare target_method FTPES"
330
- # set_info :target, :method, :ftpes
331
334
  set_info :target, :method, JOB_METHOD_FTPS
332
- # @target_method = :ftpes
333
- @remote = RemoteFTP.new target_uri, log_prefix, debug: @config[:debug_sftp], ftpes: true
335
+ @remote = RemoteFTP.new target_uri, log_prefix, debug: @config[:debug_ftps], ftpes: true
334
336
 
335
337
  elsif target_uri.is_a? URI::SFTP
336
338
  log_info "Job.prepare target_method SFTP"
337
- # set_info :target, :method, :sftp
338
339
  set_info :target, :method, JOB_METHOD_SFTP
339
- # @target_method = :sftp
340
340
  @remote = RemoteSFTP.new target_uri, log_prefix, debug: @config[:debug_sftp]
341
341
 
342
342
  else
@@ -386,6 +386,7 @@ module RestFtpDaemon
386
386
 
387
387
  # Handle each source file matched, and start a transfer
388
388
  source_processed = 0
389
+ targets = []
389
390
  sources.each do |source|
390
391
  # Compute target filename
391
392
  full_target = @target_path.clone
@@ -398,6 +399,10 @@ module RestFtpDaemon
398
399
  # Do the transfer, for each file
399
400
  remote_push source, full_target
400
401
 
402
+ # Add it to transferred target names
403
+ targets << full_target.full
404
+ set_info :target, :files, targets
405
+
401
406
  # Update counters
402
407
  set_info :source, :processed, source_processed += 1
403
408
  end
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |spec|
3
3
 
4
4
  # Project version
5
- spec.version = "0.304.0"
5
+ spec.version = "0.305.0"
6
6
 
7
7
  # Project description
8
8
  spec.name = "rest-ftp-daemon"
@@ -16,7 +16,9 @@ Gem::Specification.new do |spec|
16
16
 
17
17
 
18
18
  # List files and executables
19
- spec.files = `git ls-files -z`.split("\x0").reject{ |f| f == "dashboard.png"}
19
+ spec.files = `git ls-files -z`.
20
+ split("\x0").
21
+ reject{ |f| f =~ /^dashboard.+\.png/ }
20
22
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
23
  spec.require_paths = ["lib"]
22
24
  spec.required_ruby_version = ">= 2.2"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-ftp-daemon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.304.0
4
+ version: 0.305.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno MEDICI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-21 00:00:00.000000000 Z
11
+ date: 2016-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler