X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=lib%2Fmcollective%2Fddl%2Fbase.rb;fp=lib%2Fmcollective%2Fddl%2Fbase.rb;h=e9a99f931062d09c82bb83c48f7972c67511e97c;hb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;hp=b4e524d44898df8e4b8355f2e0a322bd73ee3d08;hpb=8a3fe7daeecccf43dd71c59371c5005400d35101;p=packages%2Fprecise%2Fmcollective.git diff --git a/lib/mcollective/ddl/base.rb b/lib/mcollective/ddl/base.rb index b4e524d..e9a99f9 100644 --- a/lib/mcollective/ddl/base.rb +++ b/lib/mcollective/ddl/base.rb @@ -38,18 +38,19 @@ module MCollective # # If no template name is provided one will be chosen based # on the plugin type. If the provided template path is - # not absolute then the template will be loaded relative to - # helptemplatedir configuration parameter + # not absolute then the template will be loaded either from + # the config dir and if that does not exist, default to + # /etc/mcollective def help(template=nil) template = template_for_plugintype unless template - template = File.join(@config.helptemplatedir, template) unless template.start_with?(File::SEPARATOR) + template = Util.templatepath(template) unless Util.absolute_path?(template) template = File.read(template) meta = @meta entities = @entities unless template == "metadata-help.erb" - metadata_template = File.join(@config.helptemplatedir, "metadata-help.erb") + metadata_template = Util.templatepath("metadata-help.erb") metadata_template = File.read(metadata_template) metastring = ERB.new(metadata_template, 0, '%') metastring = metastring.result(binding) @@ -68,7 +69,7 @@ module MCollective when :agent return "rpc-help.erb" else - if File.exists?(File.join(@config.helptemplatedir,"#{@plugintype}-help.erb")) + if File.exists?(Util.templatepath("#{@plugintype}-help.erb")) return "#{@plugintype}-help.erb" else # Default help template gets loaded if plugintype-help does not exist.