# File lib/mcollective/application/plugin.rb, line 319
    def set_plugin_type
      if plugin_directory_exists?("agent") || plugin_directory_exists?("application")
        configuration[:plugintype] = "AgentDefinition"
        return "Agent"
      elsif plugin_directory_exists?(plugintype = identify_plugin)
        configuration[:plugintype] = "StandardDefinition"
        return plugintype
      else
        raise RuntimeError, "target directory is not a valid mcollective plugin"
      end
    end