vm_shepherd 1.11.0 → 1.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vm_shepherd.rb +3 -3
- data/lib/vm_shepherd/aws_manager.rb +29 -26
- data/lib/vm_shepherd/openstack_manager.rb +30 -30
- data/lib/vm_shepherd/retry_helper.rb +2 -2
- data/lib/vm_shepherd/shepherd.rb +43 -43
- data/lib/vm_shepherd/vcloud/deployer.rb +3 -3
- data/lib/vm_shepherd/vcloud/destroyer.rb +1 -1
- data/lib/vm_shepherd/vcloud/vapp_config.rb +40 -40
- data/lib/vm_shepherd/vcloud_manager.rb +5 -5
- data/lib/vm_shepherd/version.rb +1 -1
- data/lib/vm_shepherd/vsphere_manager.rb +34 -34
- data/spec/vm_shepherd/aws_manager_spec.rb +74 -57
- data/spec/vm_shepherd/data_object_spec.rb +2 -2
- data/spec/vm_shepherd/openstack_manager_spec.rb +43 -43
- data/spec/vm_shepherd/shepherd_spec.rb +120 -120
- data/spec/vm_shepherd/vcloud/deployer_spec.rb +4 -4
- data/spec/vm_shepherd/vcloud/vapp_config_spec.rb +4 -4
- data/spec/vm_shepherd/vcloud_manager_spec.rb +43 -43
- data/spec/vm_shepherd/vsphere_manager_spec.rb +5 -5
- data/vm_shepherd.gemspec +11 -11
- metadata +3 -3
@@ -36,10 +36,10 @@ module VmShepherd
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'returns true when all attributes are equal' do
|
39
|
-
eleventy_one
|
39
|
+
eleventy_one = TestDataObject.new
|
40
40
|
hundred_and_eleven = TestDataObject.new
|
41
41
|
|
42
|
-
eleventy_one.name
|
42
|
+
eleventy_one.name = '111'
|
43
43
|
hundred_and_eleven.name = '111'
|
44
44
|
|
45
45
|
expect(eleventy_one == hundred_and_eleven).to be_truthy
|
@@ -10,23 +10,23 @@ module VmShepherd
|
|
10
10
|
{
|
11
11
|
auth_url: 'http://example.com/version/tokens',
|
12
12
|
username: 'username',
|
13
|
-
api_key:
|
14
|
-
tenant:
|
13
|
+
api_key: 'api-key',
|
14
|
+
tenant: tenant_name,
|
15
15
|
}
|
16
16
|
end
|
17
17
|
let(:openstack_vm_options) do
|
18
18
|
{
|
19
|
-
name:
|
20
|
-
flavor_name:
|
21
|
-
network_name:
|
22
|
-
key_name:
|
19
|
+
name: 'some-vm-name',
|
20
|
+
flavor_name: 'some-flavor',
|
21
|
+
network_name: 'Public',
|
22
|
+
key_name: 'some-key',
|
23
23
|
security_group_names: [
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
public_ip:
|
29
|
-
private_ip:
|
24
|
+
'security-group-A',
|
25
|
+
'security-group-B',
|
26
|
+
'security-group-C',
|
27
|
+
],
|
28
|
+
public_ip: '192.168.27.129', #magik ip to Fog::Mock
|
29
|
+
private_ip: '192.168.27.100',
|
30
30
|
}
|
31
31
|
end
|
32
32
|
|
@@ -36,11 +36,11 @@ module VmShepherd
|
|
36
36
|
it 'creates a Fog::Compute connection' do
|
37
37
|
expect(Fog::Compute).to receive(:new).with(
|
38
38
|
{
|
39
|
-
provider:
|
39
|
+
provider: 'openstack',
|
40
40
|
openstack_auth_url: openstack_options[:auth_url],
|
41
41
|
openstack_username: openstack_options[:username],
|
42
|
-
openstack_tenant:
|
43
|
-
openstack_api_key:
|
42
|
+
openstack_tenant: openstack_options[:tenant],
|
43
|
+
openstack_api_key: openstack_options[:api_key],
|
44
44
|
}
|
45
45
|
)
|
46
46
|
openstack_vm_manager.service
|
@@ -51,11 +51,11 @@ module VmShepherd
|
|
51
51
|
it 'creates a Fog::Image connection' do
|
52
52
|
expect(Fog::Image).to receive(:new).with(
|
53
53
|
{
|
54
|
-
provider:
|
55
|
-
openstack_auth_url:
|
56
|
-
openstack_username:
|
57
|
-
openstack_tenant:
|
58
|
-
openstack_api_key:
|
54
|
+
provider: 'openstack',
|
55
|
+
openstack_auth_url: openstack_options[:auth_url],
|
56
|
+
openstack_username: openstack_options[:username],
|
57
|
+
openstack_tenant: openstack_options[:tenant],
|
58
|
+
openstack_api_key: openstack_options[:api_key],
|
59
59
|
openstack_endpoint_type: 'publicURL',
|
60
60
|
}
|
61
61
|
)
|
@@ -67,11 +67,11 @@ module VmShepherd
|
|
67
67
|
it 'creates a Fog::Network connection' do
|
68
68
|
expect(Fog::Network).to receive(:new).with(
|
69
69
|
{
|
70
|
-
provider:
|
70
|
+
provider: 'openstack',
|
71
71
|
openstack_auth_url: openstack_options[:auth_url],
|
72
72
|
openstack_username: openstack_options[:username],
|
73
|
-
openstack_tenant:
|
74
|
-
openstack_api_key:
|
73
|
+
openstack_tenant: openstack_options[:tenant],
|
74
|
+
openstack_api_key: openstack_options[:api_key],
|
75
75
|
}
|
76
76
|
)
|
77
77
|
openstack_vm_manager.network_service
|
@@ -253,17 +253,17 @@ module VmShepherd
|
|
253
253
|
Fog.mock!
|
254
254
|
Fog::Mock.reset
|
255
255
|
Fog::Mock.delay = 0
|
256
|
-
Fog.interval
|
256
|
+
Fog.interval = 0
|
257
257
|
|
258
258
|
make_server_and_image!('vm1')
|
259
259
|
make_server_and_image!('vm2')
|
260
260
|
openstack_vm_manager.image_service.images.create(
|
261
|
-
name:
|
262
|
-
size:
|
263
|
-
disk_format:
|
261
|
+
name: 'public',
|
262
|
+
size: 13784321,
|
263
|
+
disk_format: 'raw',
|
264
264
|
container_format: 'bare',
|
265
|
-
location:
|
266
|
-
is_public:
|
265
|
+
location: '/tmp/notreal',
|
266
|
+
is_public: true,
|
267
267
|
)
|
268
268
|
|
269
269
|
openstack_vm_manager.storage_service.directories
|
@@ -285,26 +285,26 @@ module VmShepherd
|
|
285
285
|
|
286
286
|
def make_server_and_image!(name)
|
287
287
|
image = openstack_vm_manager.image_service.images.create(
|
288
|
-
name:
|
289
|
-
size:
|
290
|
-
disk_format:
|
288
|
+
name: name,
|
289
|
+
size: 13784321,
|
290
|
+
disk_format: 'raw',
|
291
291
|
container_format: 'bare',
|
292
|
-
location:
|
293
|
-
is_public:
|
292
|
+
location: '/tmp/notreal',
|
293
|
+
is_public: false,
|
294
294
|
)
|
295
295
|
|
296
296
|
server = openstack_vm_manager.service.servers.create(
|
297
|
-
name:
|
298
|
-
flavor_ref:
|
299
|
-
image_ref:
|
300
|
-
key_name:
|
297
|
+
name: name,
|
298
|
+
flavor_ref: openstack_vm_manager.service.flavors.first.id,
|
299
|
+
image_ref: image.id,
|
300
|
+
key_name: 'some key',
|
301
301
|
security_groups: ['some security group'],
|
302
302
|
)
|
303
303
|
|
304
304
|
volume = openstack_vm_manager.service.volumes.create(
|
305
|
-
name:
|
305
|
+
name: name,
|
306
306
|
description: "description #{name}",
|
307
|
-
size:
|
307
|
+
size: name.to_i,
|
308
308
|
)
|
309
309
|
server.attach_volume(volume.id, 'xd1')
|
310
310
|
end
|
@@ -330,7 +330,7 @@ module VmShepherd
|
|
330
330
|
|
331
331
|
allow(servers).to receive(:size)
|
332
332
|
allow(servers).to receive(:each).and_return([])
|
333
|
-
expect(servers).to receive(:count).and_return(1,0).ordered
|
333
|
+
expect(servers).to receive(:count).and_return(1, 0).ordered
|
334
334
|
expect(openstack_vm_manager.image_service).to receive(:images).and_return([]).ordered
|
335
335
|
|
336
336
|
openstack_vm_manager.clean_environment
|
@@ -352,9 +352,9 @@ module VmShepherd
|
|
352
352
|
let(:volumes) { [volume] }
|
353
353
|
let(:volume) do
|
354
354
|
openstack_vm_manager.service.volumes.create(
|
355
|
-
name:
|
355
|
+
name: 'volume',
|
356
356
|
description: 'description',
|
357
|
-
size:
|
357
|
+
size: 1,
|
358
358
|
)
|
359
359
|
end
|
360
360
|
|
@@ -11,20 +11,20 @@ module VmShepherd
|
|
11
11
|
end
|
12
12
|
let(:aws_env_config) do
|
13
13
|
{
|
14
|
-
stack_name:
|
14
|
+
stack_name: 'aws-stack-name',
|
15
15
|
aws_access_key: 'aws-access-key',
|
16
16
|
aws_secret_key: 'aws-secret-key',
|
17
|
-
region:
|
18
|
-
json_file:
|
19
|
-
parameters:
|
17
|
+
region: 'aws-region',
|
18
|
+
json_file: 'cloudformation.json',
|
19
|
+
parameters: {
|
20
20
|
'key_pair_name' => 'key_pair_name'
|
21
21
|
},
|
22
|
-
outputs:
|
23
|
-
ssh_key_name:
|
24
|
-
security_group:
|
25
|
-
public_subnet_id:
|
22
|
+
outputs: {
|
23
|
+
ssh_key_name: 'ssh-key-name',
|
24
|
+
security_group: 'security-group-id',
|
25
|
+
public_subnet_id: 'public-subnet-id',
|
26
26
|
private_subnet_id: 'private-subnet-id',
|
27
|
-
s3_bucket_name:
|
27
|
+
s3_bucket_name: 'bucket-name',
|
28
28
|
},
|
29
29
|
}.merge(aws_elb_config)
|
30
30
|
end
|
@@ -61,10 +61,10 @@ module VmShepherd
|
|
61
61
|
expect(VcloudManager).to receive(:new).
|
62
62
|
with(
|
63
63
|
{
|
64
|
-
url:
|
64
|
+
url: first_config.creds.url,
|
65
65
|
organization: first_config.creds.organization,
|
66
|
-
user:
|
67
|
-
password:
|
66
|
+
user: first_config.creds.user,
|
67
|
+
password: first_config.creds.password,
|
68
68
|
},
|
69
69
|
first_config.vdc.name,
|
70
70
|
instance_of(Logger)
|
@@ -73,10 +73,10 @@ module VmShepherd
|
|
73
73
|
expect(VcloudManager).to receive(:new).
|
74
74
|
with(
|
75
75
|
{
|
76
|
-
url:
|
76
|
+
url: last_config.creds.url,
|
77
77
|
organization: last_config.creds.organization,
|
78
|
-
user:
|
79
|
-
password:
|
78
|
+
user: last_config.creds.user,
|
79
|
+
password: last_config.creds.password,
|
80
80
|
},
|
81
81
|
last_config.vdc.name,
|
82
82
|
instance_of(Logger)
|
@@ -85,12 +85,12 @@ module VmShepherd
|
|
85
85
|
expect(first_vcloud_manager).to receive(:deploy).with(
|
86
86
|
'FIRST_FAKE_PATH',
|
87
87
|
Vcloud::VappConfig.new(
|
88
|
-
name:
|
89
|
-
ip:
|
88
|
+
name: first_config.vapp.ops_manager_name,
|
89
|
+
ip: first_config.vapp.ip,
|
90
90
|
gateway: first_config.vapp.gateway,
|
91
91
|
netmask: first_config.vapp.netmask,
|
92
|
-
dns:
|
93
|
-
ntp:
|
92
|
+
dns: first_config.vapp.dns,
|
93
|
+
ntp: first_config.vapp.ntp,
|
94
94
|
catalog: first_config.vdc.catalog,
|
95
95
|
network: first_config.vdc.network,
|
96
96
|
)
|
@@ -99,12 +99,12 @@ module VmShepherd
|
|
99
99
|
expect(last_vcloud_manager).to receive(:deploy).with(
|
100
100
|
'LAST_FAKE_PATH',
|
101
101
|
Vcloud::VappConfig.new(
|
102
|
-
name:
|
103
|
-
ip:
|
102
|
+
name: last_config.vapp.ops_manager_name,
|
103
|
+
ip: last_config.vapp.ip,
|
104
104
|
gateway: last_config.vapp.gateway,
|
105
105
|
netmask: last_config.vapp.netmask,
|
106
|
-
dns:
|
107
|
-
ntp:
|
106
|
+
dns: last_config.vapp.dns,
|
107
|
+
ntp: last_config.vapp.ntp,
|
108
108
|
catalog: last_config.vdc.catalog,
|
109
109
|
network: last_config.vdc.network,
|
110
110
|
)
|
@@ -143,36 +143,36 @@ module VmShepherd
|
|
143
143
|
expect(first_ova_manager).to receive(:deploy).with(
|
144
144
|
'FIRST_FAKE_PATH',
|
145
145
|
{
|
146
|
-
ip:
|
147
|
-
gateway:
|
148
|
-
netmask:
|
149
|
-
dns:
|
146
|
+
ip: first_config.vm.ip,
|
147
|
+
gateway: first_config.vm.gateway,
|
148
|
+
netmask: first_config.vm.netmask,
|
149
|
+
dns: first_config.vm.dns,
|
150
150
|
ntp_servers: first_config.vm.ntp_servers,
|
151
151
|
},
|
152
152
|
{
|
153
|
-
cluster:
|
153
|
+
cluster: first_config.vsphere.cluster,
|
154
154
|
resource_pool: first_config.vsphere.resource_pool,
|
155
|
-
datastore:
|
156
|
-
network:
|
157
|
-
folder:
|
155
|
+
datastore: first_config.vsphere.datastore,
|
156
|
+
network: first_config.vsphere.network,
|
157
|
+
folder: first_config.vsphere.folder,
|
158
158
|
},
|
159
159
|
)
|
160
160
|
|
161
161
|
expect(last_ova_manager).to receive(:deploy).with(
|
162
162
|
'LAST_FAKE_PATH',
|
163
163
|
{
|
164
|
-
ip:
|
165
|
-
gateway:
|
166
|
-
netmask:
|
167
|
-
dns:
|
164
|
+
ip: last_config.vm.ip,
|
165
|
+
gateway: last_config.vm.gateway,
|
166
|
+
netmask: last_config.vm.netmask,
|
167
|
+
dns: last_config.vm.dns,
|
168
168
|
ntp_servers: last_config.vm.ntp_servers,
|
169
169
|
},
|
170
170
|
{
|
171
|
-
cluster:
|
171
|
+
cluster: last_config.vsphere.cluster,
|
172
172
|
resource_pool: last_config.vsphere.resource_pool,
|
173
|
-
datastore:
|
174
|
-
network:
|
175
|
-
folder:
|
173
|
+
datastore: last_config.vsphere.datastore,
|
174
|
+
network: last_config.vsphere.network,
|
175
|
+
folder: last_config.vsphere.folder,
|
176
176
|
},
|
177
177
|
)
|
178
178
|
|
@@ -228,46 +228,46 @@ module VmShepherd
|
|
228
228
|
{
|
229
229
|
auth_url: 'http://example.com/version/tokens',
|
230
230
|
username: 'username',
|
231
|
-
api_key:
|
232
|
-
tenant:
|
231
|
+
api_key: 'api-key',
|
232
|
+
tenant: 'tenant',
|
233
233
|
}
|
234
234
|
end
|
235
235
|
let(:last_openstack_options) do
|
236
236
|
{
|
237
237
|
auth_url: 'http://example.com/version/tokens-2',
|
238
238
|
username: 'username-2',
|
239
|
-
api_key:
|
240
|
-
tenant:
|
239
|
+
api_key: 'api-key-2',
|
240
|
+
tenant: 'tenant-2',
|
241
241
|
}
|
242
242
|
end
|
243
243
|
let(:first_openstack_vm_options) do
|
244
244
|
{
|
245
|
-
name:
|
246
|
-
flavor_name:
|
247
|
-
network_name:
|
248
|
-
key_name:
|
245
|
+
name: 'some-vm-name',
|
246
|
+
flavor_name: 'some-flavor',
|
247
|
+
network_name: 'some-network',
|
248
|
+
key_name: 'some-key',
|
249
249
|
security_group_names: [
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
public_ip:
|
255
|
-
private_ip:
|
250
|
+
'security-group-A',
|
251
|
+
'security-group-B',
|
252
|
+
'security-group-C',
|
253
|
+
],
|
254
|
+
public_ip: '198.11.195.5',
|
255
|
+
private_ip: '192.168.100.100',
|
256
256
|
}
|
257
257
|
end
|
258
258
|
let(:last_openstack_vm_options) do
|
259
259
|
{
|
260
|
-
name:
|
261
|
-
flavor_name:
|
262
|
-
network_name:
|
263
|
-
key_name:
|
260
|
+
name: 'some-vm-name-2',
|
261
|
+
flavor_name: 'some-flavor-2',
|
262
|
+
network_name: 'some-network-2',
|
263
|
+
key_name: 'some-key-2',
|
264
264
|
security_group_names: [
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
public_ip:
|
270
|
-
private_ip:
|
265
|
+
'security-group-A-2',
|
266
|
+
'security-group-B-2',
|
267
|
+
'security-group-C-2',
|
268
|
+
],
|
269
|
+
public_ip: '198.11.195.5-2',
|
270
|
+
private_ip: '192.168.100.100-2',
|
271
271
|
}
|
272
272
|
end
|
273
273
|
|
@@ -304,10 +304,10 @@ module VmShepherd
|
|
304
304
|
it 'uses VcloudManager to destroy a vm' do
|
305
305
|
expect(VcloudManager).to receive(:new).with(
|
306
306
|
{
|
307
|
-
url:
|
307
|
+
url: first_config.creds.url,
|
308
308
|
organization: first_config.creds.organization,
|
309
|
-
user:
|
310
|
-
password:
|
309
|
+
user: first_config.creds.user,
|
310
|
+
password: first_config.creds.password,
|
311
311
|
},
|
312
312
|
first_config.vdc.name,
|
313
313
|
instance_of(Logger)
|
@@ -320,10 +320,10 @@ module VmShepherd
|
|
320
320
|
|
321
321
|
expect(VcloudManager).to receive(:new).with(
|
322
322
|
{
|
323
|
-
url:
|
323
|
+
url: last_config.creds.url,
|
324
324
|
organization: last_config.creds.organization,
|
325
|
-
user:
|
326
|
-
password:
|
325
|
+
user: last_config.creds.user,
|
326
|
+
password: last_config.creds.password,
|
327
327
|
},
|
328
328
|
last_config.vdc.name,
|
329
329
|
instance_of(Logger)
|
@@ -382,7 +382,7 @@ module VmShepherd
|
|
382
382
|
|
383
383
|
context 'when there is no ELB configuration' do
|
384
384
|
let(:settings_fixture_name) { 'aws-no-elb.yml' }
|
385
|
-
let(:aws_elb_config) {{}}
|
385
|
+
let(:aws_elb_config) { {} }
|
386
386
|
|
387
387
|
it 'uses AwsManager to destroy a VM' do
|
388
388
|
expect(AwsManager).to receive(:new).with(env_config: aws_env_config, logger: instance_of(Logger)).and_return(aws_manager)
|
@@ -403,46 +403,46 @@ module VmShepherd
|
|
403
403
|
{
|
404
404
|
auth_url: 'http://example.com/version/tokens',
|
405
405
|
username: 'username',
|
406
|
-
api_key:
|
407
|
-
tenant:
|
406
|
+
api_key: 'api-key',
|
407
|
+
tenant: 'tenant',
|
408
408
|
}
|
409
409
|
end
|
410
410
|
let(:first_openstack_vm_options) do
|
411
411
|
{
|
412
|
-
name:
|
413
|
-
flavor_name:
|
414
|
-
network_name:
|
415
|
-
key_name:
|
412
|
+
name: 'some-vm-name',
|
413
|
+
flavor_name: 'some-flavor',
|
414
|
+
network_name: 'some-network',
|
415
|
+
key_name: 'some-key',
|
416
416
|
security_group_names: [
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
public_ip:
|
422
|
-
private_ip:
|
417
|
+
'security-group-A',
|
418
|
+
'security-group-B',
|
419
|
+
'security-group-C',
|
420
|
+
],
|
421
|
+
public_ip: '198.11.195.5',
|
422
|
+
private_ip: '192.168.100.100',
|
423
423
|
}
|
424
424
|
end
|
425
425
|
let(:last_openstack_options) do
|
426
426
|
{
|
427
427
|
auth_url: 'http://example.com/version/tokens-2',
|
428
428
|
username: 'username-2',
|
429
|
-
api_key:
|
430
|
-
tenant:
|
429
|
+
api_key: 'api-key-2',
|
430
|
+
tenant: 'tenant-2',
|
431
431
|
}
|
432
432
|
end
|
433
433
|
let(:last_openstack_vm_options) do
|
434
434
|
{
|
435
|
-
name:
|
436
|
-
flavor_name:
|
437
|
-
network_name:
|
438
|
-
key_name:
|
435
|
+
name: 'some-vm-name-2',
|
436
|
+
flavor_name: 'some-flavor-2',
|
437
|
+
network_name: 'some-network-2',
|
438
|
+
key_name: 'some-key-2',
|
439
439
|
security_group_names: [
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
public_ip:
|
445
|
-
private_ip:
|
440
|
+
'security-group-A-2',
|
441
|
+
'security-group-B-2',
|
442
|
+
'security-group-C-2',
|
443
|
+
],
|
444
|
+
public_ip: '198.11.195.5-2',
|
445
|
+
private_ip: '192.168.100.100-2',
|
446
446
|
}
|
447
447
|
end
|
448
448
|
|
@@ -475,10 +475,10 @@ module VmShepherd
|
|
475
475
|
it 'uses VcloudManager to destroy a vm' do
|
476
476
|
expect(VcloudManager).to receive(:new).with(
|
477
477
|
{
|
478
|
-
url:
|
478
|
+
url: first_config.creds.url,
|
479
479
|
organization: first_config.creds.organization,
|
480
|
-
user:
|
481
|
-
password:
|
480
|
+
user: first_config.creds.user,
|
481
|
+
password: first_config.creds.password,
|
482
482
|
},
|
483
483
|
first_config.vdc.name,
|
484
484
|
instance_of(Logger)
|
@@ -491,10 +491,10 @@ module VmShepherd
|
|
491
491
|
|
492
492
|
expect(VcloudManager).to receive(:new).with(
|
493
493
|
{
|
494
|
-
url:
|
494
|
+
url: last_config.creds.url,
|
495
495
|
organization: last_config.creds.organization,
|
496
|
-
user:
|
497
|
-
password:
|
496
|
+
user: last_config.creds.user,
|
497
|
+
password: last_config.creds.password,
|
498
498
|
},
|
499
499
|
last_config.vdc.name,
|
500
500
|
instance_of(Logger)
|
@@ -515,16 +515,16 @@ module VmShepherd
|
|
515
515
|
let(:first_clean_environment_options) do
|
516
516
|
{
|
517
517
|
datacenter_folders_to_clean: first_config.cleanup.datacenter_folders_to_clean,
|
518
|
-
datastores:
|
519
|
-
datastore_folders_to_clean:
|
518
|
+
datastores: first_config.cleanup.datastores,
|
519
|
+
datastore_folders_to_clean: first_config.cleanup.datastore_folders_to_clean,
|
520
520
|
}
|
521
521
|
end
|
522
522
|
let(:last_ova_manager) { instance_double(VsphereManager) }
|
523
523
|
let(:last_clean_environment_options) do
|
524
524
|
{
|
525
525
|
datacenter_folders_to_clean: last_config.cleanup.datacenter_folders_to_clean,
|
526
|
-
datastores:
|
527
|
-
datastore_folders_to_clean:
|
526
|
+
datastores: last_config.cleanup.datastores,
|
527
|
+
datastore_folders_to_clean: last_config.cleanup.datastore_folders_to_clean,
|
528
528
|
}
|
529
529
|
end
|
530
530
|
|
@@ -562,7 +562,7 @@ module VmShepherd
|
|
562
562
|
|
563
563
|
context 'when there is no ELB configuration' do
|
564
564
|
let(:settings_fixture_name) { 'aws-no-elb.yml' }
|
565
|
-
let(:aws_elb_config) {{}}
|
565
|
+
let(:aws_elb_config) { {} }
|
566
566
|
|
567
567
|
it 'uses AwsManager to destroy a VM' do
|
568
568
|
expect(AwsManager).to receive(:new).with(env_config: aws_env_config, logger: instance_of(Logger)).and_return(aws_manager)
|
@@ -580,8 +580,8 @@ module VmShepherd
|
|
580
580
|
{
|
581
581
|
auth_url: 'http://example.com/version/tokens',
|
582
582
|
username: 'username',
|
583
|
-
api_key:
|
584
|
-
tenant:
|
583
|
+
api_key: 'api-key',
|
584
|
+
tenant: 'tenant',
|
585
585
|
}
|
586
586
|
end
|
587
587
|
let(:last_qcow2_manager) { instance_double(OpenstackManager) }
|
@@ -589,8 +589,8 @@ module VmShepherd
|
|
589
589
|
{
|
590
590
|
auth_url: 'http://example.com/version/tokens-2',
|
591
591
|
username: 'username-2',
|
592
|
-
api_key:
|
593
|
-
tenant:
|
592
|
+
api_key: 'api-key-2',
|
593
|
+
tenant: 'tenant-2',
|
594
594
|
}
|
595
595
|
end
|
596
596
|
|
@@ -625,7 +625,7 @@ module VmShepherd
|
|
625
625
|
|
626
626
|
context 'when there is no ELB configuration' do
|
627
627
|
let(:settings_fixture_name) { 'aws-no-elb.yml' }
|
628
|
-
let(:aws_elb_config) {{}}
|
628
|
+
let(:aws_elb_config) { {} }
|
629
629
|
|
630
630
|
it 'uses AwsManager to create an environment' do
|
631
631
|
expect(AwsManager).to receive(:new).with(env_config: aws_env_config, logger: instance_of(Logger)).and_return(ams_manager)
|
@@ -643,10 +643,10 @@ module VmShepherd
|
|
643
643
|
it 'uses VcloudManager to destroy a vm' do
|
644
644
|
expect(VcloudManager).to receive(:new).with(
|
645
645
|
{
|
646
|
-
url:
|
646
|
+
url: first_config.creds.url,
|
647
647
|
organization: first_config.creds.organization,
|
648
|
-
user:
|
649
|
-
password:
|
648
|
+
user: first_config.creds.user,
|
649
|
+
password: first_config.creds.password,
|
650
650
|
},
|
651
651
|
first_config.vdc.name,
|
652
652
|
instance_of(Logger)
|
@@ -656,10 +656,10 @@ module VmShepherd
|
|
656
656
|
|
657
657
|
expect(VcloudManager).to receive(:new).with(
|
658
658
|
{
|
659
|
-
url:
|
659
|
+
url: last_config.creds.url,
|
660
660
|
organization: last_config.creds.organization,
|
661
|
-
user:
|
662
|
-
password:
|
661
|
+
user: last_config.creds.user,
|
662
|
+
password: last_config.creds.password,
|
663
663
|
},
|
664
664
|
last_config.vdc.name,
|
665
665
|
instance_of(Logger)
|
@@ -704,8 +704,8 @@ module VmShepherd
|
|
704
704
|
{
|
705
705
|
auth_url: 'http://example.com/version/tokens',
|
706
706
|
username: 'username',
|
707
|
-
api_key:
|
708
|
-
tenant:
|
707
|
+
api_key: 'api-key',
|
708
|
+
tenant: 'tenant',
|
709
709
|
}
|
710
710
|
end
|
711
711
|
let(:last_openstack_manager) { instance_double(OpenstackManager) }
|
@@ -713,8 +713,8 @@ module VmShepherd
|
|
713
713
|
{
|
714
714
|
auth_url: 'http://example.com/version/tokens-2',
|
715
715
|
username: 'username-2',
|
716
|
-
api_key:
|
717
|
-
tenant:
|
716
|
+
api_key: 'api-key-2',
|
717
|
+
tenant: 'tenant-2',
|
718
718
|
}
|
719
719
|
end
|
720
720
|
|