cloudkeeper 1.4.1 → 1.4.2

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: 627d7ad80b5656af87fef1d88bdaa35fae85cda3
4
- data.tar.gz: c4f5fa24ab19bf98e727e9a36be4cf1581b12005
3
+ metadata.gz: 1358dc8f5002e70611207126243b106695182838
4
+ data.tar.gz: 3665cac985a187a948f973ab8ea30f1295c660c0
5
5
  SHA512:
6
- metadata.gz: feaefd01329102a82e8739c481c828f4b18df12b572bed7b4f2cde0bf4f864b1cdc5a6215db65a4434530bad569cede8ba04e6f34f5d6e4ad04d0e3394c3d8c6
7
- data.tar.gz: 7a6c49eb1bbf1db0ffd46f855db2693cd02b292d03dfd5996429b22631bfec0db367d349fd7b5eb60af30ac91d9815ef9d1e2c483c3b562f64b7c69e42fc0448
6
+ metadata.gz: 0bf08fabfc72f259b5a962bff5a4d0d98092e8dac9679f1a2da8b2057317f0c2a65a5e73e833bba04a9e0bed2efa554b2415aa1433e2a2aa111699cd20383686
7
+ data.tar.gz: 4009178fe581c3c416ad48d048bf54b290cf450f4d96f87a917fb7106223799be594daed75f3ff9d48773a21e7144eda9ffe840a438812154506a71f89b95a85
@@ -131,6 +131,9 @@ module Cloudkeeper
131
131
  end
132
132
  rescue Cloudkeeper::Errors::InvalidConfigurationError => ex
133
133
  abort ex.message
134
+ rescue => ex
135
+ logger.error "Unexpected error: #{ex.message}"
136
+ raise ex
134
137
  end
135
138
 
136
139
  desc 'version', 'Prints cloudkeeper version'
@@ -7,7 +7,7 @@ module Cloudkeeper
7
7
  image_file = acceptable_image_file image
8
8
 
9
9
  CloudkeeperGrpc::Image.new mode: :LOCAL, location: image_file.file, format: image_file.format.upcase,
10
- checksum: image_file.checksum, size: image.size.to_i, uri: image.uri
10
+ checksum: image_file.checksum, size: image_file.size.to_i, uri: image.uri
11
11
  end
12
12
 
13
13
  def convert_appliance(appliance, image_proto)
@@ -62,7 +62,7 @@ module Cloudkeeper
62
62
 
63
63
  def image_file(converted_file, output_format)
64
64
  Cloudkeeper::Entities::ImageFile.new converted_file, output_format.to_sym,
65
- Cloudkeeper::Utils::Checksum.compute(converted_file), false
65
+ Cloudkeeper::Utils::Checksum.compute(converted_file), File.size(converted_file)
66
66
  end
67
67
 
68
68
  def delete_if_exists(file)
@@ -1,17 +1,18 @@
1
1
  module Cloudkeeper
2
2
  module Entities
3
3
  class ImageFile
4
- attr_accessor :file, :checksum, :format, :original
4
+ attr_accessor :file, :format, :checksum, :size, :original
5
5
 
6
6
  include Cloudkeeper::Entities::Convertables::Convertable
7
7
 
8
- def initialize(file, format, checksum, original = false)
9
- raise Cloudkeeper::Errors::ArgumentError, 'file, format and checksum cannot be nil nor empty'\
10
- if file.blank? || format.blank? || checksum.blank?
8
+ def initialize(file, format, checksum, size, original = false)
9
+ raise Cloudkeeper::Errors::ArgumentError, 'file, format, checksum and size cannot be nil nor empty'\
10
+ if file.blank? || format.blank? || checksum.blank? || size.blank?
11
11
 
12
12
  @file = file
13
- @checksum = checksum
14
13
  @format = format
14
+ @checksum = checksum
15
+ @size = size
15
16
  @original = original
16
17
 
17
18
  format_const_symbol = format.to_s.classify.to_sym
@@ -54,7 +54,8 @@ module Cloudkeeper
54
54
  filename = generate_filename(uri)
55
55
  retrieve_image(uri, filename)
56
56
 
57
- Cloudkeeper::Entities::ImageFile.new filename, format(filename), Cloudkeeper::Utils::Checksum.compute(filename), true
57
+ Cloudkeeper::Entities::ImageFile.new filename, format(filename), Cloudkeeper::Utils::Checksum.compute(filename),
58
+ File.size(filename), true
58
59
  rescue Cloudkeeper::Errors::InvalidURLError, Cloudkeeper::Errors::Image::Format::RecognitionError,
59
60
  Cloudkeeper::Errors::ArgumentError, Cloudkeeper::Errors::NetworkConnectionError, ::IOError => ex
60
61
  raise Cloudkeeper::Errors::Image::DownloadError, ex
@@ -1,3 +1,3 @@
1
1
  module Cloudkeeper
2
- VERSION = '1.4.1'.freeze
2
+ VERSION = '1.4.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudkeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Kimle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-24 00:00:00.000000000 Z
11
+ date: 2017-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler