@@ -51,11 +51,11 @@ def set_nic_attributes(host, attributes, evaluator)
51
51
sequence ( :mac ) { |n | "00:00:00:00:" + n . to_s ( 16 ) . rjust ( 4 , '0' ) . insert ( 2 , ':' ) }
52
52
53
53
trait :with_subnet do
54
- subnet {
54
+ subnet do
55
55
FactoryGirl . build ( :subnet ,
56
56
:organizations => host ? [ host . organization ] : [ ] ,
57
57
:locations => host ? [ host . location ] : [ ] )
58
- }
58
+ end
59
59
end
60
60
end
61
61
@@ -183,9 +183,9 @@ def set_nic_attributes(host, attributes, evaluator)
183
183
184
184
trait :with_puppet do
185
185
environment
186
- puppet_proxy { FactoryGirl . create ( :smart_proxy ,
187
- :features => [ FactoryGirl . create ( :feature , :puppet ) ] )
188
- }
186
+ puppet_proxy do
187
+ FactoryGirl . create ( :smart_proxy , :features => [ FactoryGirl . create ( :feature , :puppet ) ] )
188
+ end
189
189
end
190
190
191
191
trait :managed do
@@ -204,7 +204,7 @@ def set_nic_attributes(host, attributes, evaluator)
204
204
managed
205
205
association :compute_resource , :factory => :libvirt_cr
206
206
domain
207
- subnet {
207
+ subnet do
208
208
overrides = {
209
209
:dhcp => FactoryGirl . create ( :smart_proxy ,
210
210
:features => [ FactoryGirl . create ( :feature , :dhcp ) ] )
@@ -216,36 +216,36 @@ def set_nic_attributes(host, attributes, evaluator)
216
216
:subnet ,
217
217
overrides
218
218
)
219
- }
220
- interfaces { [ FactoryGirl . build ( :nic_primary_and_provision ,
221
- :ip => subnet . network . sub ( /0\Z / , '1' ) ) ]
222
- }
219
+ end
220
+ interfaces do
221
+ [ FactoryGirl . build ( :nic_primary_and_provision , :ip => subnet . network . sub ( /0\Z / , '1' ) ) ]
222
+ end
223
223
end
224
224
225
225
trait :with_dns_orchestration do
226
226
managed
227
227
association :compute_resource , :factory => :libvirt_cr
228
- subnet {
228
+ subnet do
229
229
overrides = { :dns => FactoryGirl . create ( :smart_proxy ,
230
230
:features => [ FactoryGirl . create ( :feature , :dns ) ] ) }
231
231
#add taxonomy overrides in case it's set in the host object
232
232
overrides [ :locations ] = [ location ] unless location . nil?
233
233
overrides [ :organizations ] = [ organization ] unless organization . nil?
234
234
235
235
FactoryGirl . create ( :subnet , overrides )
236
- }
237
- domain {
236
+ end
237
+ domain do
238
238
FactoryGirl . create ( :domain ,
239
239
:dns => FactoryGirl . create ( :smart_proxy ,
240
240
:features => [ FactoryGirl . create ( :feature , :dns ) ] )
241
241
)
242
- }
243
- interfaces { [ FactoryGirl . build ( :nic_managed ,
244
- :primary => true ,
245
- :provision => true ,
246
- :domain => FactoryGirl . build ( :domain ) ,
247
- :ip => subnet . network . sub ( /0\Z / , '1' ) ) ]
248
- }
242
+ end
243
+ interfaces do
244
+ [ FactoryGirl . build ( :nic_managed , :primary => true ,
245
+ :provision => true ,
246
+ :domain => FactoryGirl . build ( :domain ) ,
247
+ :ip => subnet . network . sub ( /0\Z / , '1' ) ) ]
248
+ end
249
249
end
250
250
251
251
trait :with_tftp_subnet do
@@ -255,13 +255,13 @@ def set_nic_attributes(host, attributes, evaluator)
255
255
trait :with_tftp_orchestration do
256
256
managed
257
257
with_tftp_subnet
258
- interfaces { [ FactoryGirl . build ( :nic_managed ,
259
- :primary => true ,
260
- :provision => true ,
261
- :domain => FactoryGirl . build ( :domain ) ,
262
- :subnet => subnet ,
263
- :ip => subnet . network . sub ( /0\Z / , '2' ) ) ]
264
- }
258
+ interfaces do
259
+ [ FactoryGirl . build ( :nic_managed , :primary => true ,
260
+ :provision => true ,
261
+ :domain => FactoryGirl . build ( :domain ) ,
262
+ :subnet => subnet ,
263
+ :ip => subnet . network . sub ( /0\Z / , '2' ) ) ]
264
+ end
265
265
end
266
266
267
267
trait :with_puppet_orchestration do
@@ -270,9 +270,9 @@ def set_nic_attributes(host, attributes, evaluator)
270
270
association :compute_resource , :factory => :libvirt_cr
271
271
domain
272
272
interfaces { [ FactoryGirl . build ( :nic_primary_and_provision ) ] }
273
- puppet_ca_proxy { FactoryGirl . create ( :smart_proxy ,
274
- :features => [ FactoryGirl . create ( :feature , :puppetca ) ] )
275
- }
273
+ puppet_ca_proxy do
274
+ FactoryGirl . create ( :smart_proxy , :features => [ FactoryGirl . create ( :feature , :puppetca ) ] )
275
+ end
276
276
end
277
277
278
278
trait :with_realm do
@@ -321,15 +321,15 @@ def set_nic_attributes(host, attributes, evaluator)
321
321
trait :with_puppet_orchestration do
322
322
architecture
323
323
ptable
324
- operatingsystem { FactoryGirl . create ( :operatingsystem ,
325
- :architectures => [ architecture ] , :ptables => [ ptable ] )
326
- }
327
- puppet_ca_proxy { FactoryGirl . create ( :smart_proxy ,
328
- :features => [ FactoryGirl . create ( :feature , :puppetca ) ] )
329
- }
330
- puppet_proxy { FactoryGirl . create ( :smart_proxy ,
331
- :features => [ FactoryGirl . create ( :feature , :puppet ) ] )
332
- }
324
+ operatingsystem do
325
+ FactoryGirl . create ( :operatingsystem , :architectures => [ architecture ] , :ptables => [ ptable ] )
326
+ end
327
+ puppet_ca_proxy do
328
+ FactoryGirl . create ( :smart_proxy , :features => [ FactoryGirl . create ( :feature , :puppetca ) ] )
329
+ end
330
+ puppet_proxy do
331
+ FactoryGirl . create ( :smart_proxy , :features => [ FactoryGirl . create ( :feature , :puppet ) ] )
332
+ end
333
333
end
334
334
end
335
335
end
0 commit comments