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 +4 -4
- data/lib/cloudkeeper/cli.rb +3 -0
- data/lib/cloudkeeper/entities/conversions.rb +1 -1
- data/lib/cloudkeeper/entities/convertables/convertable.rb +1 -1
- data/lib/cloudkeeper/entities/image_file.rb +6 -5
- data/lib/cloudkeeper/managers/image_manager.rb +2 -1
- data/lib/cloudkeeper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1358dc8f5002e70611207126243b106695182838
|
4
|
+
data.tar.gz: 3665cac985a187a948f973ab8ea30f1295c660c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bf08fabfc72f259b5a962bff5a4d0d98092e8dac9679f1a2da8b2057317f0c2a65a5e73e833bba04a9e0bed2efa554b2415aa1433e2a2aa111699cd20383686
|
7
|
+
data.tar.gz: 4009178fe581c3c416ad48d048bf54b290cf450f4d96f87a917fb7106223799be594daed75f3ff9d48773a21e7144eda9ffe840a438812154506a71f89b95a85
|
data/lib/cloudkeeper/cli.rb
CHANGED
@@ -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:
|
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),
|
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, :
|
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
|
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),
|
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
|
data/lib/cloudkeeper/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|