Class: Puppet::Provider::Patronictl
- Inherits:
-
Puppet::Provider
- Object
- Puppet::Provider
- Puppet::Provider::Patronictl
- Defined in:
- lib/puppet/provider/patronictl.rb
Overview
Parent class for patronictl providers
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
-
.path ⇒ Object
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
7 8 9 |
# File 'lib/puppet/provider/patronictl.rb', line 7 def config @config end |
.path ⇒ Object
Returns the value of attribute path.
6 7 8 |
# File 'lib/puppet/provider/patronictl.rb', line 6 def path @path end |
Class Method Details
.flatten_hash(hash) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/puppet/provider/patronictl.rb', line 29 def self.flatten_hash(hash) hash.each_with_object({}) do |(k, v), h| if v.is_a? Hash flatten_hash(v).map do |h_k, h_v| h["#{k}.#{h_k}"] = h_v end else h[k] = v end end end |
.patronictl(args, options = {}) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/puppet/provider/patronictl.rb', line 10 def self.patronictl(args, = {}) cmd = [@path] + ['-c', @config] + args = { combine: true, override_locale: false, custom_environment: { 'LC_ALL' => 'en_US.utf8' } } ret = execute(cmd, .merge()) ret end |
.type_properties ⇒ Object
21 22 23 |
# File 'lib/puppet/provider/patronictl.rb', line 21 def self.type_properties resource_type.validproperties.reject { |p| p.to_sym == :ensure } end |
Instance Method Details
#patronictl(*args) ⇒ Object
17 18 19 |
# File 'lib/puppet/provider/patronictl.rb', line 17 def patronictl(*args) self.class.patronictl(*args) end |
#type_properties ⇒ Object
25 26 27 |
# File 'lib/puppet/provider/patronictl.rb', line 25 def type_properties self.class.type_properties end |