vmfloaty 0.9.0 → 0.9.1

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
  SHA256:
3
- metadata.gz: 7b08c0be5bb4c8a57ce706db190b37bdf89532e30964aca13bd53dc4b2649d46
4
- data.tar.gz: aeaeb37cde837b342ddd438b6e3c389e9e84b12fd6caa36a40fcd87ff8b0427b
3
+ metadata.gz: 3f04ad5dd857d55ff4d7dfa42eb344952bb2eac10d4601a911d8e7255e212d09
4
+ data.tar.gz: 6b2b56d9cd35e5d48062116a7c17129ed0c4404d2fe9c00461fbc6ab90570181
5
5
  SHA512:
6
- metadata.gz: d7bb8b68a6dcc391184c910883e4d05c1d7c8580dd7d969f141959fdd46b0e4a9ef4c7ec141a3d4526cab557923d80d0db62e8ae11e8fd76120d2d0e5367fde8
7
- data.tar.gz: d0bb6b6ff8fd727a110814ebd3836dcd344b30c0e0fb5791ac4485ed0fafe2d715d00173e7d874ec9a41488eaecd0709d1ce53a8c5162419e3285912a1746b2d
6
+ metadata.gz: b1785b87fc949e6088f0a8d0d17ce0a599a75bf6d117758adba8583c6aeeb88ff56b4ab3dff217cfc8029ae2115254a3a7a02e864db29a60ab6dac6d7b1eb597
7
+ data.tar.gz: 2d5ebc3d83665e5fcf5f6bc7ef362f5d8a340e95e456ca859579264eae7d8fa3cd447f880355efec03e31a6de4daba2a816ad46b4e0bf69b5a692949e71ba753
@@ -290,4 +290,16 @@ class ABS
290
290
  res = conn.get "host/#{hostname}"
291
291
  JSON.parse(res.body)
292
292
  end
293
+
294
+ def self.modify(_verbose, _url, _hostname, _token, _modify_hash)
295
+ raise NoMethodError, 'modify is not defined for ABS'
296
+ end
297
+
298
+ def self.disk(_verbose, _url, _hostname, _token, _disk)
299
+ raise NoMethodError, 'disk is not defined for ABS'
300
+ end
301
+
302
+ def self.revert(_verbose, _url, _hostname, _token, _snapshot_sha)
303
+ raise NoMethodError, 'revert is not defined for ABS'
304
+ end
293
305
  end
@@ -77,7 +77,7 @@ class NonstandardPooler
77
77
  raise ModifyError, 'Configured service type does not support snapshots'
78
78
  end
79
79
 
80
- def self.delete(verbose, url, hosts, token)
80
+ def self.delete(verbose, url, hosts, token, _user)
81
81
  raise TokenError, 'Token provided was nil; Request cannot be made to delete VM' if token.nil?
82
82
 
83
83
  conn = Http.get_conn(verbose, url)
@@ -94,7 +94,7 @@ class Pooler
94
94
  res_body
95
95
  end
96
96
 
97
- def self.delete(verbose, url, hosts, token)
97
+ def self.delete(verbose, url, hosts, token, _user)
98
98
  raise TokenError, 'Token provided was nil. Request cannot be made to delete vm' if token.nil?
99
99
 
100
100
  conn = Http.get_conn(verbose, url)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Vmfloaty
4
- VERSION = '0.9.0'
4
+ VERSION = '0.9.1'
5
5
  end
@@ -274,7 +274,7 @@ describe NonstandardPooler do
274
274
  .with(:headers => @auth_token_headers)
275
275
  .to_return(:status => 200, :body => @delete_response_success, :headers => {})
276
276
 
277
- request = NonstandardPooler.delete(false, @nspooler_url, 'sol11-7', 'token-value')
277
+ request = NonstandardPooler.delete(false, @nspooler_url, 'sol11-7', 'token-value', nil)
278
278
  expect(request['sol11-7']['ok']).to be true
279
279
  end
280
280
 
@@ -283,7 +283,7 @@ describe NonstandardPooler do
283
283
  .with(:headers => @auth_token_headers)
284
284
  .to_return(:status => 401, :body => @delete_response_failure, :headers => {})
285
285
 
286
- request = NonstandardPooler.delete(false, @nspooler_url, 'fakehost', 'token-value')
286
+ request = NonstandardPooler.delete(false, @nspooler_url, 'fakehost', 'token-value', nil)
287
287
  expect(request['fakehost']['ok']).to be false
288
288
  end
289
289
  end
@@ -119,11 +119,11 @@ describe Pooler do
119
119
  .with(:headers => { 'X-Auth-Token' => 'mytokenfile' })
120
120
  .to_return(:status => 200, :body => @delete_response_body_success, :headers => {})
121
121
 
122
- expect(Pooler.delete(false, @vmpooler_url, ['fq6qlpjlsskycq6'], 'mytokenfile')).to eq @delete_response
122
+ expect(Pooler.delete(false, @vmpooler_url, ['fq6qlpjlsskycq6'], 'mytokenfile', nil)).to eq @delete_response
123
123
  end
124
124
 
125
125
  it 'raises a token error if no token provided' do
126
- expect { Pooler.delete(false, @vmpooler_url, ['myfakehost'], nil) }.to raise_error(TokenError)
126
+ expect { Pooler.delete(false, @vmpooler_url, ['myfakehost'], nil, nil) }.to raise_error(TokenError)
127
127
  end
128
128
  end
129
129
 
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ # All of the interfaces for the different services must be the
4
+ # same, otherwise there will be errors when you change the caller
5
+ # for the services from services.rb.
6
+ #
7
+
8
+ require_relative '../../lib/vmfloaty/pooler'
9
+ require_relative '../../lib/vmfloaty/abs'
10
+ require_relative '../../lib/vmfloaty/nonstandard_pooler'
11
+
12
+ shared_examples 'a vmfloaty service' do
13
+ it { is_expected.to respond_to(:delete).with(5).arguments }
14
+ it { is_expected.to respond_to(:disk).with(5).arguments }
15
+ it { is_expected.to respond_to(:list).with(3).arguments }
16
+ it { is_expected.to respond_to(:list_active).with(4).arguments }
17
+ it { is_expected.to respond_to(:modify).with(5).arguments }
18
+ it { is_expected.to respond_to(:retrieve).with(6).arguments }
19
+ it { is_expected.to respond_to(:revert).with(5).arguments }
20
+ it { is_expected.to respond_to(:query).with(3).arguments }
21
+ it { is_expected.to respond_to(:snapshot).with(4).arguments }
22
+ it { is_expected.to respond_to(:status).with(2).arguments }
23
+ it { is_expected.to respond_to(:summary).with(2).arguments }
24
+ end
25
+
26
+ describe Pooler do
27
+ subject { Pooler }
28
+ it_behaves_like 'a vmfloaty service'
29
+ end
30
+
31
+ describe ABS do
32
+ subject { ABS }
33
+ it_behaves_like 'a vmfloaty service'
34
+ end
35
+
36
+ describe NonstandardPooler do
37
+ subject { NonstandardPooler }
38
+ it_behaves_like 'a vmfloaty service'
39
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmfloaty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Cain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-17 00:00:00.000000000 Z
11
+ date: 2020-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -84,6 +84,7 @@ files:
84
84
  - spec/vmfloaty/pooler_spec.rb
85
85
  - spec/vmfloaty/service_spec.rb
86
86
  - spec/vmfloaty/utils_spec.rb
87
+ - spec/vmfloaty/vmfloaty_services_spec.rb
87
88
  homepage: https://github.com/briancain/vmfloaty
88
89
  licenses:
89
90
  - Apache-2.0
@@ -116,4 +117,5 @@ test_files:
116
117
  - spec/vmfloaty/nonstandard_pooler_spec.rb
117
118
  - spec/vmfloaty/abs_spec.rb
118
119
  - spec/vmfloaty/pooler_spec.rb
120
+ - spec/vmfloaty/vmfloaty_services_spec.rb
119
121
  - spec/vmfloaty/abs/auth_spec.rb