fog-brightbox 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/CHANGELOG.md +18 -0
- data/lib/fog/brightbox/compute/image_selector.rb +3 -1
- data/lib/fog/brightbox/models/compute/database_server.rb +3 -0
- data/lib/fog/brightbox/version.rb +1 -1
- data/spec/fog/brightbox/config_spec.rb +3 -3
- data/spec/fog/brightbox/link_helper_spec.rb +1 -1
- data/spec/fog/brightbox/storage/authentication_request_spec.rb +4 -4
- data/spec/fog/compute/brightbox/database_server_spec.rb +16 -1
- data/spec/fog/storage/brightbox_spec.rb +4 -4
- data/tests/brightbox/compute_tests.rb +2 -2
- data/tests/brightbox/requests/compute/collaboration_tests.rb +4 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfa9b2e98e5691a853fa9b6e68f37de41f10ac081d04402d4be4c5842b1ba930
|
4
|
+
data.tar.gz: d95737e730099ba23713c5f4c2c196c2e7aab63387c7febe1e3d2608a84174b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43a52dc0cb5a4444eafd03d9ad6414bc3a08ab826d97e658a505229d4c7a32b2267ced2206e7d7e9f19cbc0dc02576d172fce9eb1f786c69d75f8808e0134ad8
|
7
|
+
data.tar.gz: fbb69efe2d339176ba36bab0ba55da159e45a525adeeb0d742819e52617a3d0f61b9e5c6b7d2e0fc2a275fc56eac15ae026cad6f4fa8446145a6c510f19b5183
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
### 1.1.0 / 2020-06-30
|
2
|
+
|
3
|
+
Changes:
|
4
|
+
|
5
|
+
* Add Ruby 2.6 and 2.7 to Travis CI testing matrix.
|
6
|
+
* Remove bundler installation step from Travis CI.
|
7
|
+
* Use `example.test` for testing domains rather than `example.com` to avoid
|
8
|
+
leaking routable traffic.
|
9
|
+
* Add `FOG_TEST_COLLABORATOR_EMAIL` to enable ENV based setting of email
|
10
|
+
address when using the tests for integation tests.`
|
11
|
+
|
12
|
+
Bug fixes:
|
13
|
+
|
14
|
+
* Add `status` check to `ImageSelector` so that unavailable images were not
|
15
|
+
selected for use automatically and causing failures in tests.
|
16
|
+
* Fix creating database servers from snapshots by adding the `snapshot_id`
|
17
|
+
attribute ensuring the value is not filtered when using the model.
|
18
|
+
|
1
19
|
### 1.0.0 / 2018-10-05
|
2
20
|
|
3
21
|
Major Changes:
|
@@ -28,6 +28,7 @@ module Fog
|
|
28
28
|
def latest_ubuntu
|
29
29
|
@images.select do |img|
|
30
30
|
img["official"] == true &&
|
31
|
+
img["status"] == "available" &&
|
31
32
|
img["arch"] == "i686" &&
|
32
33
|
img["name"] =~ /ubuntu/i
|
33
34
|
end.sort do |a, b|
|
@@ -46,7 +47,8 @@ module Fog
|
|
46
47
|
def official_minimal
|
47
48
|
@images.select do |img|
|
48
49
|
img["official"] == true &&
|
49
|
-
|
50
|
+
img["status"] == "available" &&
|
51
|
+
img["virtual_size"] != 0
|
50
52
|
end.sort_by do |img|
|
51
53
|
img["disk_size"]
|
52
54
|
end.first["id"]
|
@@ -34,6 +34,8 @@ module Fog
|
|
34
34
|
attribute :flavor_id, "alias" => "database_server_type", :squash => "id"
|
35
35
|
attribute :zone_id, "alias" => "zone", :squash => "id"
|
36
36
|
|
37
|
+
attribute :snapshot_id
|
38
|
+
|
37
39
|
attribute :cloud_ips
|
38
40
|
|
39
41
|
def save
|
@@ -54,6 +56,7 @@ module Fog
|
|
54
56
|
options[:version] = database_version if database_version
|
55
57
|
options[:database_type] = flavor_id if flavor_id
|
56
58
|
options[:zone] = zone_id if zone_id
|
59
|
+
options[:snapshot] = snapshot_id if snapshot_id
|
57
60
|
|
58
61
|
data = create_database_server(options)
|
59
62
|
end
|
@@ -220,7 +220,7 @@ describe Fog::Brightbox::Config do
|
|
220
220
|
@options = {
|
221
221
|
:brightbox_client_id => "app-12345",
|
222
222
|
:brightbox_secret => "12345",
|
223
|
-
:brightbox_username => "user@example.
|
223
|
+
:brightbox_username => "user@example.test",
|
224
224
|
:brightbox_password => "12345"
|
225
225
|
}
|
226
226
|
@config = Fog::Brightbox::Config.new(@options)
|
@@ -241,7 +241,7 @@ describe Fog::Brightbox::Config do
|
|
241
241
|
|
242
242
|
describe "when setting management_url with URI" do
|
243
243
|
it "sets it correctly" do
|
244
|
-
uri = URI.parse("https://example.
|
244
|
+
uri = URI.parse("https://example.test")
|
245
245
|
@config = Fog::Brightbox::Config.new
|
246
246
|
@config.storage_management_url = uri
|
247
247
|
assert_equal @config.storage_management_url, uri
|
@@ -250,7 +250,7 @@ describe Fog::Brightbox::Config do
|
|
250
250
|
|
251
251
|
describe "when setting management_url with String" do
|
252
252
|
it "raises ArgumentError" do
|
253
|
-
uri = "http://example.
|
253
|
+
uri = "http://example.test/wrong"
|
254
254
|
assert_raises(ArgumentError) { Fog::Brightbox::Config.new.storage_management_url = uri }
|
255
255
|
end
|
256
256
|
end
|
@@ -3,7 +3,7 @@ require "spec_helper"
|
|
3
3
|
describe Fog::Brightbox::LinkHelper do
|
4
4
|
describe "when initialized with an RFC5988 value" do
|
5
5
|
before do
|
6
|
-
@header = "<https://www.example.
|
6
|
+
@header = "<https://www.example.test/1.0/images/img-12345>; rel=snapshot"
|
7
7
|
@helper = Fog::Brightbox::LinkHelper.new(@header)
|
8
8
|
end
|
9
9
|
|
@@ -47,7 +47,7 @@ describe Fog::Brightbox::Storage::AuthenticationRequest do
|
|
47
47
|
stub_request(:get, "https://orbit.brightbox.com/v1").
|
48
48
|
with(:headers => {
|
49
49
|
"Host" => "orbit.brightbox.com:443",
|
50
|
-
"X-Auth-User" => "user@example.
|
50
|
+
"X-Auth-User" => "user@example.test",
|
51
51
|
"X-Auth-Key" => "abcde"
|
52
52
|
}).to_return(authorized_response)
|
53
53
|
end
|
@@ -56,7 +56,7 @@ describe Fog::Brightbox::Storage::AuthenticationRequest do
|
|
56
56
|
settings = {
|
57
57
|
:brightbox_client_id => "app-12345",
|
58
58
|
:brightbox_secret => "12345",
|
59
|
-
:brightbox_username => "user@example.
|
59
|
+
:brightbox_username => "user@example.test",
|
60
60
|
:brightbox_password => "abcde"
|
61
61
|
}
|
62
62
|
@config = Fog::Brightbox::Config.new(settings)
|
@@ -70,7 +70,7 @@ describe Fog::Brightbox::Storage::AuthenticationRequest do
|
|
70
70
|
stub_request(:get, "https://orbit.brightbox.com/v1").
|
71
71
|
with(:headers => {
|
72
72
|
"Host" => "orbit.brightbox.com:443",
|
73
|
-
"X-Auth-User" => "user@example.
|
73
|
+
"X-Auth-User" => "user@example.test",
|
74
74
|
"X-Auth-Key" => "abcde"
|
75
75
|
}).to_return(unauthorized_response)
|
76
76
|
end
|
@@ -79,7 +79,7 @@ describe Fog::Brightbox::Storage::AuthenticationRequest do
|
|
79
79
|
settings = {
|
80
80
|
:brightbox_client_id => "app-12345",
|
81
81
|
:brightbox_secret => "12345",
|
82
|
-
:brightbox_username => "user@example.
|
82
|
+
:brightbox_username => "user@example.test",
|
83
83
|
:brightbox_password => "abcde"
|
84
84
|
}
|
85
85
|
@config = Fog::Brightbox::Config.new(settings)
|
@@ -19,7 +19,7 @@ describe Fog::Brightbox::Compute::DatabaseServer do
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
describe "when snapshotting
|
22
|
+
describe "when snapshotting with no options" do
|
23
23
|
it "returns the database server" do
|
24
24
|
stub_request(:post, "http://localhost/1.0/database_servers/dbs-12345/snapshot").
|
25
25
|
with(:query => hash_including(:account_id),
|
@@ -47,4 +47,19 @@ describe Fog::Brightbox::Compute::DatabaseServer do
|
|
47
47
|
assert_kind_of Fog::Brightbox::Compute::DatabaseSnapshot, @database_server.snapshot(true)
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
describe "when building from a snapshot" do
|
52
|
+
it "returns the new SQL instance" do
|
53
|
+
stub_request(:post, "http://localhost/1.0/database_servers").
|
54
|
+
with(:query => hash_including(:account_id),
|
55
|
+
:headers => { "Authorization" => "Bearer FAKECACHEDTOKEN" },
|
56
|
+
:body => hash_including(:snapshot => "dbi-lv426")).
|
57
|
+
to_return(:status => 202, :body => %q({"id": "dbs-12345"}))
|
58
|
+
|
59
|
+
@database_server = Fog::Brightbox::Compute::DatabaseServer.new(:service => service, :snapshot_id => "dbi-lv426")
|
60
|
+
@database_server.save
|
61
|
+
assert_kind_of Fog::Brightbox::Compute::DatabaseServer, @database_server
|
62
|
+
assert_equal "dbs-12345", @database_server.id
|
63
|
+
end
|
64
|
+
end
|
50
65
|
end
|
@@ -89,7 +89,7 @@ describe Fog::Brightbox::Storage do
|
|
89
89
|
{
|
90
90
|
:brightbox_client_id => "app-12345",
|
91
91
|
:brightbox_secret => "12345",
|
92
|
-
:brightbox_username => "user@example.
|
92
|
+
:brightbox_username => "user@example.test",
|
93
93
|
:brightbox_password => "abcde",
|
94
94
|
:brightbox_account => "acc-abcde"
|
95
95
|
}
|
@@ -111,7 +111,7 @@ describe Fog::Brightbox::Storage do
|
|
111
111
|
{
|
112
112
|
:brightbox_client_id => "app-12345",
|
113
113
|
:brightbox_secret => "12345",
|
114
|
-
:brightbox_username => "user@example.
|
114
|
+
:brightbox_username => "user@example.test",
|
115
115
|
:brightbox_password => "abcde"
|
116
116
|
}
|
117
117
|
end
|
@@ -204,7 +204,7 @@ describe Fog::Brightbox::Storage do
|
|
204
204
|
{
|
205
205
|
:brightbox_client_id => "app-12345",
|
206
206
|
:brightbox_secret => "12345",
|
207
|
-
:brightbox_username => "user@example.
|
207
|
+
:brightbox_username => "user@example.test",
|
208
208
|
:brightbox_password => "12345",
|
209
209
|
:brightbox_access_token => "1234567890abcdefghijklmnopqrstuvwxyz",
|
210
210
|
:brightbox_refresh_token => "1234567890abcdefghijklmnopqrstuvwxyz",
|
@@ -221,7 +221,7 @@ describe Fog::Brightbox::Storage do
|
|
221
221
|
|
222
222
|
# The reauthentication
|
223
223
|
stub_request(:get, "https://files.gb2.brightbox.com/v1").
|
224
|
-
with(:headers => { "X-Auth-User" => "user@example.
|
224
|
+
with(:headers => { "X-Auth-User" => "user@example.test", "X-Auth-Key" => "12345" }).
|
225
225
|
to_return(authorized_response)
|
226
226
|
|
227
227
|
# Repeated request
|
@@ -9,8 +9,8 @@ end
|
|
9
9
|
Shindo.tests("Fog::Compute.new", ["brightbox"]) do
|
10
10
|
tests("service options") do
|
11
11
|
{
|
12
|
-
:brightbox_api_url => "https://example.
|
13
|
-
:brightbox_auth_url => "https://example.
|
12
|
+
:brightbox_api_url => "https://example.test",
|
13
|
+
:brightbox_auth_url => "https://example.test",
|
14
14
|
:brightbox_client_id => "app-12345",
|
15
15
|
:brightbox_secret => "12345abdef6789",
|
16
16
|
:brightbox_username => "user-12345",
|
@@ -1,8 +1,11 @@
|
|
1
1
|
Shindo.tests("Fog::Compute[:brightbox] | collaboration requests", ["brightbox"]) do
|
2
2
|
tests("success") do
|
3
|
+
@test_collaborator_email = ENV["FOG_TEST_COLLABORATOR_EMAIL"]
|
4
|
+
pending unless @test_collaborator_email
|
5
|
+
|
3
6
|
tests("#create_collaboration") do
|
4
7
|
pending if Fog.mocking?
|
5
|
-
collaboration = Fog::Compute[:brightbox].create_collaboration(:email =>
|
8
|
+
collaboration = Fog::Compute[:brightbox].create_collaboration(:email => @test_collaborator_email, :role => "admin")
|
6
9
|
@collaboration_id = collaboration["id"]
|
7
10
|
formats(Brightbox::Compute::Formats::Full::COLLABORATION, false) { collaboration }
|
8
11
|
end
|
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: 1.
|
4
|
+
version: 1.1.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:
|
11
|
+
date: 1970-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -465,8 +465,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
465
465
|
- !ruby/object:Gem::Version
|
466
466
|
version: '0'
|
467
467
|
requirements: []
|
468
|
-
|
469
|
-
rubygems_version: 2.7.6
|
468
|
+
rubygems_version: 3.0.6
|
470
469
|
signing_key:
|
471
470
|
specification_version: 4
|
472
471
|
summary: This library can be used as a module for `fog` or as standalone provider
|