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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 876948d01d3b3b5038bc053b009c147a38c82d0a
4
- data.tar.gz: a9effe6554b8e64fcd8c12fc44bc3a970e540646
3
+ metadata.gz: e8881b79b7f599dc69e620e5cc40b5498bea0510
4
+ data.tar.gz: 8fb97ca29f661d446c43ade614c2878b0083aedf
5
5
  SHA512:
6
- metadata.gz: '0138d16a0c66c26e8502b92fc077c70e9e75a89b7343530465f963553ca1e88fb865fdd889e0ce8dd1c19f2c180d051e5986dac8d93e3e67f2e2b555bd1ee3d4'
7
- data.tar.gz: 00ba16aa4296c9e43aa0818c09fd853d163e991803e39438615ee8aafdc8e76d5a9809d68d216a76dd62caec43323230f2ee3955a5e0682d10132fe669bafd38
6
+ metadata.gz: e7a1016947d951de3e02b9eafaf9999e909b4f4fbdb99e3189e4a0d27745d9fe312fb21ed845b102fba6f2cbbe12ba07a231c16f5ae1428d574f5213a6b7f2d6
7
+ data.tar.gz: 5fcb1d00873814fc89d0b0eb30a78a4be68756a8e9add8e8d3c0644e7eb5010bc2b4b74c2d1ddd079eee4e7c8056a26fd78d0c76e46dcf628ccde3dbed35496d
@@ -139,11 +139,11 @@ module Cloudkeeper
139
139
 
140
140
  def validate_configuration!
141
141
  validate_configuration_group! :authentication,
142
- %i(certificate key backend-certificate),
142
+ %i[certificate key backend-certificate],
143
143
  'Authentication configuration missing'
144
144
  validate_configuration_group! :'remote-mode',
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),
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(vo expiration image_list_identifier).freeze
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 = {})
@@ -4,7 +4,7 @@ module Cloudkeeper
4
4
  module Entities
5
5
  module Convertables
6
6
  module Convertable
7
- CONVERT_OUTPUT_FORMATS = %i(raw qcow2 vmdk).freeze
7
+ CONVERT_OUTPUT_FORMATS = %i[raw qcow2 vmdk].freeze
8
8
 
9
9
  def self.convert_output_formats
10
10
  CONVERT_OUTPUT_FORMATS
@@ -2,7 +2,7 @@ module Cloudkeeper
2
2
  module Entities
3
3
  module Convertables
4
4
  module Ova
5
- CONVERT_OUTPUT_FORMATS = %i(raw qcow2).freeze
5
+ CONVERT_OUTPUT_FORMATS = %i[raw qcow2].freeze
6
6
 
7
7
  def self.convert_output_formats
8
8
  CONVERT_OUTPUT_FORMATS
@@ -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/http'
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
- Net::HTTP.start(uri.host, uri.port) do |http|
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(http https))}\z/
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
@@ -1,3 +1,3 @@
1
1
  module Cloudkeeper
2
- VERSION = '1.1.3'.freeze
2
+ VERSION = '1.1.4'.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.1.3
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-03 00:00:00.000000000 Z
11
+ date: 2017-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler