Files
puppet-nova/lib/puppet/provider/nova_config/parsed.rb
Dan Bode 76d4632229 folsom changes
includes changes to make nova work on folsom:
- db char set needs to be latin1 in folsom
- nova-novncproxy package needs to be installed
- nova-novncproxy is now the vnc proxy service
- root_helper replaces with root_wrap_config
- don't need deprecated auth anymore.
- add compute_driver
- make ini provider for parsed config the default
2012-10-09 22:30:14 -07:00

39 lines
971 B
Ruby

require 'puppet/provider/parsedfile'
Puppet::Type.type(:nova_config).provide(
:parsed,
:parent => Puppet::Provider::ParsedFile,
:default_target => Puppet::Type.type(:nova_config).default_target,
:filetype => :flat
) do
#confine :exists => novaconf
text_line :comment, :match => /^\s*#/;
text_line :blank, :match => /^\s*$/;
record_line :parsed,
:fields => %w{line},
:match => /--(.*)/ ,
:post_parse => proc { |hash|
Puppet.debug("nova config line:#{hash[:line]} has been parsed")
if hash[:line] =~ /^\s*(\S+?)\s*=\s*([\S ]+)\s*$/
hash[:name]=$1
hash[:value]=$2
elsif hash[:line] =~ /^\s*no(\S+)\s*$/
hash[:name]=$1
hash[:value]=false
elsif hash[:line] =~ /^\s*(\S+)\s*$/
hash[:name]=$1
hash[:value]=true
else
raise Puppet::Error, "Invalid line: #{hash[:line]}"
end
}
def self.to_line(hash)
"--#{hash[:name]}=#{hash[:value]}"
end
end