462: def legacy_to_mode(type, param)
463: if not defined?(@app_names)
464: require 'puppet/util/command_line'
465: command_line = Puppet::Util::CommandLine.new
466: @app_names = Puppet::Util::CommandLine::LegacyName.inject({}) do |hash, pair|
467: app, legacy = pair
468: command_line.require_application app
469: hash[legacy.to_sym] = Puppet::Application.find(app).run_mode.name
470: hash
471: end
472: end
473: if new_type = @app_names[type]
474: Puppet.warning "You have configuration parameter $#{param} specified in [#{type}], which is a deprecated section. I'm assuming you meant [#{new_type}]"
475: return new_type
476: end
477: type
478: end