hammer_cli_katello 0.13.3 → 0.13.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c986520c7269bb372ae951449583bb5a9ecdc176
4
- data.tar.gz: e907badfbd1b54a1d210de801c1c6109a1725e50
3
+ metadata.gz: 4556bee10b52aedbf3caa32c550a164d21ff2ca7
4
+ data.tar.gz: 667182ec87a5e00546aca103c4edb87d7aeac9b5
5
5
  SHA512:
6
- metadata.gz: 7cf1fa2ba30493f3df29ffb603d799ed22707bc4531984a98435dbc032656fe917e28b8aeecd82c45b6f5e76b456620bd20f1e18c425a5a660add29ac18b00cb
7
- data.tar.gz: 51e0bb6f6a08bce5b49f03d0101fa605bba935fc7fdae225685bb421c38a83302d12642f3a62aa0a8936f3c0eb61811e46113c5ad481455d9ec29fb23b8739b2
6
+ metadata.gz: b9e0a2894fad21f851f1c82393cc99515846e0175e0aecbd5a46c2fba5867f102359c4e49b2cc520e7ed848bf963af2ad5760776c1c1fd514b0524a1f1eef196
7
+ data.tar.gz: 71da3a347a16002c09230ccce59b0e65ed0e5225c31fe7e2a4f8808b0f395631d8ae018e63bf94198424e276e7c7eb92480f2590f2e33d8edd5e3d21f32304a9
@@ -238,8 +238,9 @@ module HammerCLIKatello
238
238
  }
239
239
  ], last_file: true)
240
240
  print_message _("Repository updated")
241
- rescue
241
+ rescue => e
242
242
  @failure = true
243
+ logger.error e
243
244
  output.print_error _("Failed to upload tag '%s' to repository.") % tag
244
245
  ensure
245
246
  content_upload_resource.call(:destroy, :repository_id => get_identifier, :id => upload_id)
@@ -282,7 +283,7 @@ module HammerCLIKatello
282
283
 
283
284
  resource :repositories, :upload_content
284
285
  command_name "upload-content"
285
- CONTENT_CHUNK_SIZE = 4_000_000 # bytes
286
+ CONTENT_CHUNK_SIZE = 2_500_000 # bytes to make sure it's lower than django's default 2621440
286
287
 
287
288
  class BinaryPath < HammerCLI::Options::Normalizers::File
288
289
  def format(path)
@@ -379,8 +380,9 @@ module HammerCLIKatello
379
380
  ], opts)
380
381
 
381
382
  print_results(filename, results)
382
- rescue
383
+ rescue => e
383
384
  @failure = true
385
+ logger.error e
384
386
  output.print_error _("Failed to upload file '%s' to repository. Please check "\
385
387
  "the file and try again.") % filename
386
388
  ensure
@@ -405,7 +407,11 @@ module HammerCLIKatello
405
407
  :multipart => true
406
408
  }
407
409
 
408
- content_upload_resource.call(:update, params, request_headers)
410
+ # To workaround rest-client bug with false negative warnings,
411
+ # see https://github.com/rest-client/rest-client/pull/670 for more details
412
+ silence_warnings do
413
+ content_upload_resource.call(:update, params, request_headers)
414
+ end
409
415
  offset += CONTENT_CHUNK_SIZE
410
416
  end
411
417
  end
@@ -441,6 +447,16 @@ module HammerCLIKatello
441
447
  end
442
448
  end
443
449
  end
450
+
451
+ def silence_warnings
452
+ original_verbose = $VERBOSE
453
+ $VERBOSE = nil
454
+ begin
455
+ yield
456
+ ensure
457
+ $VERBOSE = original_verbose
458
+ end
459
+ end
444
460
  end
445
461
  # rubocop:enable ClassLength
446
462
 
@@ -1,5 +1,5 @@
1
1
  module HammerCLIKatello
2
2
  def self.version
3
- @version ||= Gem::Version.new('0.13.3')
3
+ @version ||= Gem::Version.new('0.13.4')
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_katello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3
4
+ version: 0.13.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Price
@@ -34,7 +34,7 @@ authors:
34
34
  autorequire:
35
35
  bindir: bin
36
36
  cert_chain: []
37
- date: 2018-06-28 00:00:00.000000000 Z
37
+ date: 2018-07-19 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: hammer_cli_foreman