puppet-ironic/lib/puppet/provider/ironic_api_paste_ini/ini_setting.rb
ZhongShengping a70ee4fb7e Add api_paste type/provider for Ironic
Add ironic_api_paste_ini type/provider for Ironic.
Also add the capability to configure api-paste.ini with config.pp.
Closes-bug: #1483371

Change-Id: I0a5ba71e577b87ad469fd624a73033a1a8ea6b82
2016-02-16 09:23:11 +08:00

28 lines
466 B
Ruby

Puppet::Type.type(:ironic_api_paste_ini).provide(
:ini_setting,
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do
def section
resource[:name].split('/', 2).first
end
def setting
resource[:name].split('/', 2).last
end
def separator
'='
end
def self.file_path
'/etc/ironic/api-paste.ini'
end
# added for backwards compatibility with older versions of inifile
def file_path
self.class.file_path
end
end