fog-openstack 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +12 -1
- data/fog-openstack.gemspec +3 -0
- data/gemfiles/Gemfile-1.9 +3 -0
- data/lib/fog/openstack/models/compute/server.rb +1 -1
- data/lib/fog/openstack/models/compute/services.rb +12 -0
- data/lib/fog/openstack/requests/compute/evacuate_server.rb +5 -6
- data/lib/fog/openstack/version.rb +1 -1
- data/tests/openstack/models/compute/service_tests.rb +17 -0
- metadata +45 -3
- data/.rspec +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e282e95abf02b0be1feaf68de539e9f46dac483b
|
4
|
+
data.tar.gz: 267e6a26085dd1f653d3dc29873b3f2da90ea4ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2673e523851172fdba9bd090628a702183420790368f4153901824e4a645dc35050264e7caf5eba5bba1ed7f56f8d22b3c394b21f2d16efcd0c54420775abc08
|
7
|
+
data.tar.gz: eb67d3fb407504402fa618a80f6b863beab72f2625f5fe364f2d3acc48743c0187008a5b80e9c6be6eb3c236148e4e9ddaed7ab9469796dc5bb8f1d922ac3691
|
data/Rakefile
CHANGED
@@ -1,12 +1,23 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
2
|
require 'rubocop/rake_task'
|
3
|
+
require "minitest/spec"
|
3
4
|
|
4
5
|
RuboCop::RakeTask.new
|
5
6
|
|
6
7
|
task :default => :test
|
7
8
|
|
8
9
|
desc 'Run fog-openstack unit tests'
|
9
|
-
mock = ENV['FOG_MOCK'] || 'true'
|
10
10
|
task :test do
|
11
|
+
mock = ENV['FOG_MOCK'] || 'true'
|
11
12
|
sh("export FOG_MOCK=#{mock} && bundle exec shindont")
|
12
13
|
end
|
14
|
+
|
15
|
+
require 'rake/testtask'
|
16
|
+
|
17
|
+
desc "Run fog-openstack unit tests for /spec"
|
18
|
+
Rake::TestTask.new do |t|
|
19
|
+
t.name = 'spec'
|
20
|
+
t.libs.push [ "lib", "spec" ]
|
21
|
+
t.pattern = 'spec/**/*_spec.rb'
|
22
|
+
t.verbose = true
|
23
|
+
end
|
data/fog-openstack.gemspec
CHANGED
@@ -31,4 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency 'rubocop'
|
32
32
|
spec.add_development_dependency 'rubyzip', '~> 0.9.9'
|
33
33
|
spec.add_development_dependency 'shindo', '~> 0.3'
|
34
|
+
spec.add_development_dependency 'minitest'
|
35
|
+
spec.add_development_dependency 'vcr'
|
36
|
+
spec.add_development_dependency 'webmock'
|
34
37
|
end
|
data/gemfiles/Gemfile-1.9
CHANGED
@@ -302,7 +302,7 @@ module Fog
|
|
302
302
|
service.live_migrate_server(id, host, block_migration, disk_over_commit)
|
303
303
|
end
|
304
304
|
|
305
|
-
def evacuate(host, on_shared_storage, admin_password = nil)
|
305
|
+
def evacuate(host = nil, on_shared_storage = true, admin_password = nil)
|
306
306
|
requires :id
|
307
307
|
service.evacuate_server(id, host, on_shared_storage, admin_password)
|
308
308
|
end
|
@@ -17,6 +17,18 @@ module Fog
|
|
17
17
|
Fog::Logger.deprecation('Calling OpenStack[:compute].services.details is deprecated, use .services.all')
|
18
18
|
all(options)
|
19
19
|
end
|
20
|
+
|
21
|
+
def get(service_id)
|
22
|
+
# OpenStack API currently does not support getting single service from it
|
23
|
+
# There is a blueprint https://blueprints.launchpad.net/nova/+spec/get-service-by-id
|
24
|
+
# with spec proposal patch https://review.openstack.org/#/c/172412/ but this is abandoned.
|
25
|
+
serv = service.list_services.body['services'].detect do |s|
|
26
|
+
s['id'] == service_id
|
27
|
+
end
|
28
|
+
new(serv) if serv
|
29
|
+
rescue Fog::Compute::OpenStack::NotFound
|
30
|
+
nil
|
31
|
+
end
|
20
32
|
end
|
21
33
|
end
|
22
34
|
end
|
@@ -2,13 +2,12 @@ module Fog
|
|
2
2
|
module Compute
|
3
3
|
class OpenStack
|
4
4
|
class Real
|
5
|
-
def evacuate_server(server_id, host, on_shared_storage, admin_password = nil)
|
5
|
+
def evacuate_server(server_id, host = nil, on_shared_storage = true, admin_password = nil)
|
6
|
+
evacuate = {'onSharedStorage' => on_shared_storage}
|
7
|
+
evacuate['host'] = host if host
|
8
|
+
evacuate['adminPass'] = admin_password if admin_password
|
6
9
|
body = {
|
7
|
-
'evacuate' =>
|
8
|
-
'host' => host,
|
9
|
-
'onSharedStorage' => on_shared_storage,
|
10
|
-
'admin_password' => admin_password,
|
11
|
-
}
|
10
|
+
'evacuate' => evacuate
|
12
11
|
}
|
13
12
|
server_action(server_id, body)
|
14
13
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Shindo.tests("Fog::Compute[:openstack] | services", ['openstack']) do
|
2
|
+
tests('success') do
|
3
|
+
tests('#all').succeeds do
|
4
|
+
services = Fog::Compute[:openstack].services.all
|
5
|
+
@service = services.first
|
6
|
+
end
|
7
|
+
|
8
|
+
tests('#get').succeeds do
|
9
|
+
service = Fog::Compute[:openstack].services.get(@service.id)
|
10
|
+
%w(id binary host).all? do |attr|
|
11
|
+
attr1 = service.send(attr.to_sym)
|
12
|
+
attr2 = @service.send(attr.to_sym)
|
13
|
+
attr1 == attr2
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-openstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Darby
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -164,6 +164,48 @@ dependencies:
|
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0.3'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: minitest
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: vcr
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: webmock
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
167
209
|
description: OpenStack fog provider gem.
|
168
210
|
email:
|
169
211
|
- matt.darby@rackspace.com
|
@@ -173,7 +215,6 @@ extra_rdoc_files: []
|
|
173
215
|
files:
|
174
216
|
- ".gitignore"
|
175
217
|
- ".hound.yml"
|
176
|
-
- ".rspec"
|
177
218
|
- ".rubocop.yml"
|
178
219
|
- ".ruby-gemset"
|
179
220
|
- ".ruby-version"
|
@@ -918,6 +959,7 @@ files:
|
|
918
959
|
- tests/openstack/models/compute/images_tests.rb
|
919
960
|
- tests/openstack/models/compute/security_group_tests.rb
|
920
961
|
- tests/openstack/models/compute/server_tests.rb
|
962
|
+
- tests/openstack/models/compute/service_tests.rb
|
921
963
|
- tests/openstack/models/identity/ec2_credential_tests.rb
|
922
964
|
- tests/openstack/models/identity/ec2_credentials_tests.rb
|
923
965
|
- tests/openstack/models/identity/role_tests.rb
|
data/.rspec
DELETED