Set the nova_config default target in the type instead of the provider
This makes it possible to run the spec tests on systems without a valid provider.
This commit is contained in:
parent
273d94e94e
commit
f64e532e8a
@ -1,11 +1,8 @@
|
||||
require 'puppet/provider/parsedfile'
|
||||
|
||||
novaconf = "/etc/nova/nova.conf"
|
||||
|
||||
Puppet::Type.type(:nova_config).provide(
|
||||
:parsed,
|
||||
:parent => Puppet::Provider::ParsedFile,
|
||||
:default_target => novaconf,
|
||||
:filetype => :flat
|
||||
) do
|
||||
|
||||
|
@ -1,11 +1,8 @@
|
||||
require 'puppet/provider/parsedfile'
|
||||
|
||||
novaconf = "/etc/nova/nova.conf"
|
||||
|
||||
Puppet::Type.type(:nova_config).provide(
|
||||
:configfile,
|
||||
:parent => Puppet::Provider::ParsedFile,
|
||||
:default_target => novaconf,
|
||||
:filetype => :flat
|
||||
) do
|
||||
|
||||
|
@ -16,11 +16,7 @@ Puppet::Type.newtype(:nova_config) do
|
||||
newproperty(:target) do
|
||||
desc "Path to our nova config file"
|
||||
defaultto {
|
||||
if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
|
||||
@resource.class.defaultprovider.default_target
|
||||
else
|
||||
nil
|
||||
end
|
||||
"/etc/nova/nova.conf"
|
||||
}
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user