fog-brightbox 0.10.1 → 0.11.0

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: 9c28ca44885cfca0c16893b489aeb64a32ec84c9
4
- data.tar.gz: dd8856df812db4ab4aa5764bfc2aa8dfc17bd852
3
+ metadata.gz: f78b9cfb19a9695c3f61d48c1531e65fadecd5ba
4
+ data.tar.gz: c56ae129b326f0b8319346012659e3dba8f4d402
5
5
  SHA512:
6
- metadata.gz: b8b9a9fe8cfb320c70818017b2a1fc921ecf5d642a156455864aa210a05acd30f5f56e23471ebf8d9c519829bae6cea73d32998573bd08943408c6eb1013f6c4
7
- data.tar.gz: 74efd800d3dcabee7ce6b5185f8bc772c2630bb504bc61d727f67cb875f1f1f1d169321e1f7387642e6598dc8c9a7b5ffa14cb23a82bc53c5b6d53ca5ee8ed7e
6
+ metadata.gz: 9f74b56fee22796c8cafc290643723c9f7ffbcd41ed6ba3c47f03c5ae104ade57c46cffa5b972407392242fa9d51066aa2c621e9dc54a8f05fa79c544e5b782b
7
+ data.tar.gz: 1deee7feb6c5fcdfda834c3735d049cc9f3dbeb9d52434ea78fb8ab9ad8c4f4b8135ad475deac6dcba4766e9200ad3a2fcdef084c2eb1ab56463b42e7eb1b2d2
@@ -6,7 +6,5 @@ rvm:
6
6
  - 2.0.0
7
7
  matrix:
8
8
  include:
9
- - rvm: 1.8.7
10
- gemfile: gemfiles/Gemfile.1.8.7
11
9
  - rvm: 1.9.3
12
10
  gemfile: gemfiles/Gemfile.1.9.3
@@ -1,3 +1,19 @@
1
+ ### 0.11.0 / 2016-07-05
2
+
3
+ Enchancements:
4
+
5
+ * Exposed fields on database servers related to automatic scheduled snapshots.
6
+
7
+ Bug fixes:
8
+
9
+ * Removed an error spec broken by Excon v0.50 undergoing a change of error
10
+ namespace breaking loading of the specs at present.
11
+
12
+ Changes:
13
+
14
+ * Stop testing Ruby 1.8.7 due to bitrot, the dependencies are creating more
15
+ issues than needed.
16
+
1
17
  ### 0.10.1 / 2015-12-01
2
18
 
3
19
  Bug fixes:
@@ -22,8 +22,6 @@ module Fog
22
22
  # * Latest by name (alphanumeric sort)
23
23
  # * Latest by creation date
24
24
  #
25
- # @note This performs a live query against the API
26
- #
27
25
  # @return [String] if image matches containing the identifier
28
26
  # @return [NilClass] if no image matches
29
27
  #
@@ -36,7 +34,23 @@ module Fog
36
34
  # Reverse sort so "raring" > "precise" and "13.10" > "13.04"
37
35
  b["name"].downcase <=> a["name"].downcase
38
36
  end.first["id"]
39
- rescue
37
+ rescue StandardError
38
+ nil
39
+ end
40
+
41
+ # Returns current identifier of the smallest official image
42
+ #
43
+ # @return [String] if image matches containing the identifier
44
+ # @return [NilClass] if no image matches
45
+ #
46
+ def official_minimal
47
+ @images.select do |img|
48
+ img["official"] == true &&
49
+ img["virtual_size"] != 0
50
+ end.sort_by do |img|
51
+ img["disk_size"]
52
+ end.first["id"]
53
+ rescue StandardError
40
54
  nil
41
55
  end
42
56
  end
@@ -21,6 +21,10 @@ module Fog
21
21
  attribute :maintenance_weekday
22
22
  attribute :maintenance_hour
23
23
 
24
+ # This is a crontab formatted string e.g. "* 5 * * 0"
25
+ attribute :snapshots_schedule, :type => :string
26
+ attribute :snapshots_schedule_next_at, :type => :time
27
+
24
28
  attribute :created_at, :type => :time
25
29
  attribute :updated_at, :type => :time
26
30
  attribute :deleted_at, :type => :time
@@ -40,8 +44,6 @@ module Fog
40
44
 
41
45
  options[:allow_access] = allow_access if allow_access
42
46
 
43
- # These may be nil which sets them to default values upstream
44
- # TODO: Dirty track the values so we don't send them when already nil
45
47
  options[:maintenance_weekday] = maintenance_weekday
46
48
  options[:maintenance_hour] = maintenance_hour
47
49
 
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Brightbox
3
- VERSION = "0.10.1"
3
+ VERSION = "0.11.0"
4
4
  end
5
5
  end
@@ -37,7 +37,7 @@ describe Fog::Brightbox::Storage::Connection do
37
37
  416 => Excon::Errors::RequestedRangeNotSatisfiable,
38
38
  417 => Excon::Errors::ExpectationFailed,
39
39
  422 => Excon::Errors::UnprocessableEntity,
40
- 500 => Excon::Errors::InternalServerError,
40
+ # 500 => Excon::Errors::InternalServerError,
41
41
  501 => Excon::Errors::NotImplemented,
42
42
  502 => Excon::Errors::BadGateway,
43
43
  503 => Excon::Errors::ServiceUnavailable,
@@ -13,10 +13,8 @@ class Brightbox
13
13
  # @return [String,NilClass] the most suitable test image's identifier or nil
14
14
  def self.image_id
15
15
  return @image_id unless @image_id.nil?
16
- image = select_testing_image_from_api
17
- @image_id = image["id"]
18
- rescue
19
- @image_id = nil
16
+ images = Fog::Compute[:brightbox].list_images
17
+ @image_id = Fog::Brightbox::Compute::ImageSelector.new(images).official_minimal
20
18
  end
21
19
 
22
20
  # Prepare a test server, wait for it to be usable but raise if it fails
@@ -29,14 +27,6 @@ class Brightbox
29
27
  end
30
28
  server
31
29
  end
32
-
33
- private
34
-
35
- def self.select_testing_image_from_api
36
- images = Fog::Compute[:brightbox].list_images
37
- raise "No available images!" if images.empty?
38
- images.select { |img| img["official"] && img["virtual_size"] != 0 }.sort_by { |img| img["disk_size"] }.first || images.first
39
- end
40
30
  end
41
31
  end
42
32
  end
@@ -55,6 +55,10 @@ Shindo.tests("Fog::Compute[:brightbox] | server requests", ["brightbox"]) do
55
55
  data_matches_schema(Brightbox::Compute::Formats::Full::SERVER, :allow_extra_keys => true) { result }
56
56
  end
57
57
 
58
+ unless Fog.mocking?
59
+ Fog::Compute[:brightbox].servers.get(server_id).wait_for { ready? }
60
+ end
61
+
58
62
  tests("#shutdown_server('#{server_id}')") do
59
63
  pending if Fog.mocking?
60
64
  result = Fog::Compute[:brightbox].shutdown_server(server_id)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-brightbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Thornthwaite
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-01 00:00:00.000000000 Z
11
+ date: 2016-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -167,7 +167,6 @@ files:
167
167
  - README.md
168
168
  - Rakefile
169
169
  - fog-brightbox.gemspec
170
- - gemfiles/Gemfile.1.8.7
171
170
  - gemfiles/Gemfile.1.9.3
172
171
  - lib/fog/brightbox.rb
173
172
  - lib/fog/brightbox/compute.rb
@@ -461,7 +460,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
461
460
  version: '0'
462
461
  requirements: []
463
462
  rubyforge_project:
464
- rubygems_version: 2.4.5.1
463
+ rubygems_version: 2.4.8
465
464
  signing_key:
466
465
  specification_version: 4
467
466
  summary: This library can be used as a module for `fog` or as standalone provider
@@ -504,4 +503,3 @@ test_files:
504
503
  - spec/spec_helper.rb
505
504
  - spec/stock_storage_responses.rb
506
505
  - spec/supports_resource_locking.rb
507
- has_rdoc:
@@ -1,8 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "fog-core", :github => "fog/fog-core"
4
- gem "json"
5
- gem "mime-types", "~> 1.22"
6
- gem "inflecto", "~> 0.0.2"
7
-
8
- gemspec :path => ".."