cloudkeeper 1.1.3 → 1.1.4
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 -3
- data/lib/cloudkeeper/entities/appliance.rb +1 -1
- data/lib/cloudkeeper/entities/convertables/convertable.rb +1 -1
- data/lib/cloudkeeper/entities/convertables/ova.rb +1 -1
- data/lib/cloudkeeper/managers/appliance_manager.rb +1 -0
- data/lib/cloudkeeper/managers/image_manager.rb +9 -3
- data/lib/cloudkeeper/utils/url.rb +1 -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: e8881b79b7f599dc69e620e5cc40b5498bea0510
|
4
|
+
data.tar.gz: 8fb97ca29f661d446c43ade614c2878b0083aedf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7a1016947d951de3e02b9eafaf9999e909b4f4fbdb99e3189e4a0d27745d9fe312fb21ed845b102fba6f2cbbe12ba07a231c16f5ae1428d574f5213a6b7f2d6
|
7
|
+
data.tar.gz: 5fcb1d00873814fc89d0b0eb30a78a4be68756a8e9add8e8d3c0644e7eb5010bc2b4b74c2d1ddd079eee4e7c8056a26fd78d0c76e46dcf628ccde3dbed35496d
|
data/lib/cloudkeeper/cli.rb
CHANGED
@@ -139,11 +139,11 @@ module Cloudkeeper
|
|
139
139
|
|
140
140
|
def validate_configuration!
|
141
141
|
validate_configuration_group! :authentication,
|
142
|
-
%i
|
142
|
+
%i[certificate key backend-certificate],
|
143
143
|
'Authentication configuration missing'
|
144
144
|
validate_configuration_group! :'remote-mode',
|
145
|
-
%i
|
146
|
-
nginx-ip-address nginx-min-port nginx-max-port
|
145
|
+
%i[nginx-binary nginx-error-log-file nginx-access-log-file nginx-pid-file
|
146
|
+
nginx-ip-address nginx-min-port nginx-max-port],
|
147
147
|
'NGINX configuration missing'
|
148
148
|
end
|
149
149
|
|
@@ -4,7 +4,7 @@ module Cloudkeeper
|
|
4
4
|
attr_accessor :identifier, :description, :mpuri, :title, :group, :ram, :core, :version, :architecture
|
5
5
|
attr_accessor :operating_system, :image, :attributes, :vo, :expiration_date, :image_list_identifier
|
6
6
|
|
7
|
-
REJECTED_ATTRIBUTES = %i
|
7
|
+
REJECTED_ATTRIBUTES = %i[vo expiration image_list_identifier].freeze
|
8
8
|
|
9
9
|
def initialize(identifier, mpuri, vo, expiration_date, image_list_identifier, title = '', description = '', group = '',
|
10
10
|
ram = 1024, core = 1, version = '', architecture = '', operating_system = '', image = nil, attributes = {})
|
@@ -51,6 +51,7 @@ module Cloudkeeper
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def sync_image_list(image_list_identifier)
|
54
|
+
logger.debug "Synchronizing appliances for image list with id #{image_list_identifier.inspect}"
|
54
55
|
backend_appliances = backend_connector.appliances image_list_identifier
|
55
56
|
image_list_appliances = image_list_manager.image_lists[image_list_identifier].appliances
|
56
57
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'net/
|
1
|
+
require 'net/https'
|
2
2
|
|
3
3
|
module Cloudkeeper
|
4
4
|
module Managers
|
@@ -60,16 +60,22 @@ module Cloudkeeper
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def retrieve_image(uri, filename)
|
63
|
-
|
63
|
+
use_ssl = uri.scheme == 'https'
|
64
|
+
Net::HTTP.start(uri.host, uri.port, use_ssl: use_ssl) do |http|
|
64
65
|
request = Net::HTTP::Get.new(uri)
|
65
66
|
|
66
67
|
http.request(request) do |response|
|
68
|
+
if response.is_a? Net::HTTPRedirection
|
69
|
+
retrieve_image URI.join(uri, response.header['location']), filename
|
70
|
+
break
|
71
|
+
end
|
72
|
+
|
67
73
|
response.value
|
68
74
|
open(filename, 'w') { |file| response.read_body { |chunk| file.write(chunk) } }
|
69
75
|
end
|
70
76
|
end
|
71
77
|
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED, Net::HTTPBadResponse,
|
72
|
-
Net::HTTPHeaderSyntaxError, EOFError, Net::HTTPServerException => ex
|
78
|
+
Net::HTTPHeaderSyntaxError, EOFError, Net::HTTPServerException, Net::HTTPRetriableError => ex
|
73
79
|
raise Cloudkeeper::Errors::NetworkConnectionError, ex
|
74
80
|
end
|
75
81
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Cloudkeeper
|
2
2
|
module Utils
|
3
3
|
class URL
|
4
|
-
URL_REGEXP = /\A#{URI.regexp(%w
|
4
|
+
URL_REGEXP = /\A#{URI.regexp(%w[http https])}\z/
|
5
5
|
|
6
6
|
def self.check!(url)
|
7
7
|
raise Cloudkeeper::Errors::InvalidURLError, "#{url.inspect} is not a valid URL" unless url =~ URL_REGEXP
|
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.1.
|
4
|
+
version: 1.1.4
|
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-04-
|
11
|
+
date: 2017-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|