File tree 2 files changed +25
-1
lines changed
lib/puppet/provider/network_config
spec/unit/provider/network_config
2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ def self.format_file(filename, providers)
184
184
185
185
# Map everything to a flat hash
186
186
NAME_MAPPINGS . keys . each do |type_name |
187
- if ( val = provider . send ( type_name ) )
187
+ if ( val = provider . send ( type_name ) ) && val != :absent
188
188
props [ type_name ] = val
189
189
end
190
190
end
Original file line number Diff line number Diff line change @@ -376,6 +376,22 @@ def fixture_data(file)
376
376
)
377
377
end
378
378
379
+ let ( :eth1_provider ) do
380
+ stub ( 'eth1_provider' ,
381
+ :name => 'eth1' ,
382
+ :ensure => :present ,
383
+ :onboot => :absent ,
384
+ :hotplug => true ,
385
+ :family => 'inet' ,
386
+ :method => 'none' ,
387
+ :ipaddress => :absent ,
388
+ :netmask => :absent ,
389
+ :mtu => :absent ,
390
+ :mode => :vlan ,
391
+ :options => :absent ,
392
+ )
393
+ end
394
+
379
395
let ( :lo_provider ) do
380
396
stub ( 'lo_provider' ,
381
397
:name => 'lo' ,
@@ -439,6 +455,14 @@ def fixture_data(file)
439
455
it { expect ( data ) . to match ( /VLAN=yes/ ) }
440
456
end
441
457
458
+ describe 'with test interface eth1' do
459
+ let ( :data ) { described_class . format_file ( 'filepath' , [ eth1_provider ] ) }
460
+
461
+ it { expect ( data ) . to match ( /DEVICE=eth1/ ) }
462
+ it { expect ( data ) . to match ( /VLAN=yes/ ) }
463
+ it { expect ( data ) . to_not match ( /absent/ ) }
464
+ end
465
+
442
466
describe 'with test interface bond0' do
443
467
let ( :data ) { described_class . format_file ( 'filepath' , [ bond0_provider ] ) }
444
468
You can’t perform that action at this time.
0 commit comments