arista-eosplus / puppet-eos

Puppet modules for managing Arista EOS nodes
BSD 3-Clause "New" or "Revised" License
9 stars 8 forks source link

Default value for staging_file not used for eos_switchconfig #140

Open tcyrus opened 5 years ago

tcyrus commented 5 years ago

Using this example puppet config example1.pp:

$running_config = ... # Config is a string
eos_switchconfig { 'running-config':
  content => $running_config,
}
-bash-4.3# puppet apply example1.pp --trace
...
Error: /Stage[main]/Main/Eos_switchconfig[running-config]: Could not evaluate: no implicit conversion of nil into String
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/errors.rb:106:in `fail'
/opt/puppetlabs/puppet/modules/eos/lib/puppet/provider/eos_switchconfig/default.rb:102:in `rescue in flush'
/opt/puppetlabs/puppet/modules/eos/lib/puppet/provider/eos_switchconfig/default.rb:88:in `flush'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1006:in `flush'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:25:in `evaluate'
...

Manually patched /opt/puppetlabs/puppet/modules/eos/lib/puppet/provider/eos_switchconfig/default.rb to resolve issue