Class: Puppet::ResourceApi::PuppetContext
- Inherits:
-
BaseContext
- Object
- BaseContext
- Puppet::ResourceApi::PuppetContext
- Defined in:
- lib/puppet/resource_api/puppet_context.rb
Overview
Implement Resource API Context to log through Puppet facilities and access/expose the puppet process’ current device/transport
Instance Attribute Summary
Attributes inherited from BaseContext
Instance Method Summary collapse
- #device ⇒ Object
- #log_exception(exception, message: 'Error encountered', trace: false) ⇒ Object
- #transport ⇒ Object
Methods inherited from BaseContext
#attribute_changed, #failed, #failed?, #failing, #feature_support?, #initialize, #processed, #processing, #reset_failed
Constructor Details
This class inherits a constructor from Puppet::ResourceApi::BaseContext
Instance Method Details
#device ⇒ Object
9 10 11 12 13 |
# File 'lib/puppet/resource_api/puppet_context.rb', line 9 def device # TODO: evaluate facter_url setting for loading config if there is no `current` NetworkDevice raise 'no device configured' unless Puppet::Util::NetworkDevice.current Puppet::Util::NetworkDevice.current end |
#log_exception(exception, message: 'Error encountered', trace: false) ⇒ Object
19 20 21 |
# File 'lib/puppet/resource_api/puppet_context.rb', line 19 def log_exception(exception, message: 'Error encountered', trace: false) super(exception, message: , trace: trace || Puppet[:trace]) end |
#transport ⇒ Object
15 16 17 |
# File 'lib/puppet/resource_api/puppet_context.rb', line 15 def transport device.transport end |