bosh_openstack_cpi 0.0.6 → 0.0.7
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.
- data/USAGE.md +2 -0
- data/lib/cloud/openstack/cloud.rb +4 -1
- data/lib/cloud/openstack/version.rb +1 -1
- data/spec/spec_helper.rb +2 -1
- data/spec/unit/cloud_spec.rb +3 -24
- metadata +4 -4
data/USAGE.md
CHANGED
@@ -19,6 +19,8 @@ These options are passed to the OpenStack CPI when it is instantiated.
|
|
19
19
|
OpenStack tenant name
|
20
20
|
* `region` (optional)
|
21
21
|
OpenStack region
|
22
|
+
* `endpoint_type` (optional)
|
23
|
+
OpenStack endpoint type for Glance
|
22
24
|
* `default_key_name` (required)
|
23
25
|
default OpenStack ssh key name to assign to created virtual machines
|
24
26
|
* `default_security_group` (required)
|
@@ -47,7 +47,10 @@ module Bosh::OpenStackCloud
|
|
47
47
|
:openstack_auth_url => @openstack_properties["auth_url"],
|
48
48
|
:openstack_username => @openstack_properties["username"],
|
49
49
|
:openstack_api_key => @openstack_properties["api_key"],
|
50
|
-
:openstack_tenant => @openstack_properties["tenant"]
|
50
|
+
:openstack_tenant => @openstack_properties["tenant"],
|
51
|
+
:openstack_region => @openstack_properties["region"],
|
52
|
+
:openstack_endpoint_type => @openstack_properties["endpoint_type"] ||
|
53
|
+
"publicURL"
|
51
54
|
}
|
52
55
|
@glance = Fog::Image.new(glance_params)
|
53
56
|
|
data/spec/spec_helper.rb
CHANGED
@@ -46,7 +46,8 @@ def mock_cloud_options
|
|
46
46
|
"auth_url" => "http://127.0.0.1:5000/v2.0/tokens",
|
47
47
|
"username" => "admin",
|
48
48
|
"api_key" => "nova",
|
49
|
-
"tenant" => "admin"
|
49
|
+
"tenant" => "admin",
|
50
|
+
"region" => "RegionOne"
|
50
51
|
},
|
51
52
|
"registry" => {
|
52
53
|
"endpoint" => "localhost:42288",
|
data/spec/unit/cloud_spec.rb
CHANGED
@@ -17,36 +17,15 @@ describe Bosh::OpenStackCloud::Cloud do
|
|
17
17
|
options = Hash.new("options")
|
18
18
|
expect {
|
19
19
|
Bosh::OpenStackCloud::Cloud.new(options)
|
20
|
-
}.to raise_error(ArgumentError)
|
20
|
+
}.to raise_error(ArgumentError, /Invalid OpenStack configuration/)
|
21
21
|
end
|
22
22
|
|
23
|
-
it "raises ArgumentError on initializing with non
|
23
|
+
it "raises ArgumentError on initializing with non Hash options" do
|
24
24
|
options = "this is a string"
|
25
25
|
expect {
|
26
26
|
Bosh::OpenStackCloud::Cloud.new(options)
|
27
|
-
}.to raise_error(ArgumentError)
|
27
|
+
}.to raise_error(ArgumentError, /Invalid OpenStack configuration/)
|
28
28
|
end
|
29
29
|
|
30
|
-
it "should create a Cloud Instance on giving valid params" do
|
31
|
-
openstack = { "auth_url" => "http://localhost/",
|
32
|
-
"username" =>"testuser",
|
33
|
-
"api_key" => "test_api_key",
|
34
|
-
"tenant" => "test_tenant"
|
35
|
-
}
|
36
|
-
registry = { "endpoint" => "http://0.0.0.0",
|
37
|
-
"user" => "testuser",
|
38
|
-
"password" => "password"
|
39
|
-
}
|
40
|
-
options = { "openstack" => openstack,
|
41
|
-
"registry" => registry
|
42
|
-
}
|
43
|
-
socket_error = false
|
44
|
-
begin
|
45
|
-
cloud = Bosh::OpenStackCloud::Cloud.new(options)
|
46
|
-
rescue Excon::Errors::SocketError => e
|
47
|
-
socket_error = true
|
48
|
-
end
|
49
|
-
socket_error.should be_true
|
50
|
-
end
|
51
30
|
end
|
52
31
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh_openstack_cpi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fog
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
21
|
+
version: 1.9.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.
|
29
|
+
version: 1.9.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: bosh_common
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|