Skip to content

Commit

Permalink
Merge pull request #1149 from cosmo0920/migrate-v0.14-in_debug_agent
Browse files Browse the repository at this point in the history
Migrate v0.14 in_debug_agent
  • Loading branch information
tagomoris authored Aug 10, 2016
2 parents 1980ab1 + 2eb5128 commit 8262007
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions lib/fluent/command/debug.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
require 'fluent/log'
require 'fluent/engine'
require 'fluent/system_config'
require 'serverengine'

include Fluent::SystemConfig::Mixin

Expand Down Expand Up @@ -90,13 +91,12 @@

puts "Connected to #{uri}."
puts "Usage:"
puts " Engine.match('some.tag').output : get an output plugin instance"
puts " Engine.sources[i] : get input plugin instances"
puts " Plugin.load_plugin(type,name) : load plugin class (use this if you get DRb::DRbUnknown)"
puts " Fluent::Engine.match('some.tag').output : get an output plugin instance"
puts " Fluent::Engine.sources[i] : get input plugin instances"
puts " Fluent::Plugin.load_plugin(type,name) : load plugin class (use this if you get DRb::DRbUnknown)"
puts ""

Encoding.default_internal = nil if Encoding.respond_to?(:default_internal)

require 'irb'
IRB.start

10 changes: 5 additions & 5 deletions lib/fluent/plugin/in_debug_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
# limitations under the License.
#

require 'fluent/input'
require 'fluent/plugin/input'

module Fluent
module Fluent::Plugin
class DebugAgentInput < Input
Plugin.register_input('debug_agent', self)
Fluent::Plugin.register_input('debug_agent', self)

def initialize
require 'drb/drb'
Expand All @@ -30,13 +30,13 @@ def initialize
config_param :port, :integer, default: 24230
config_param :unix_path, :string, default: nil
#config_param :unix_mode # TODO
config_param :object, :string, default: 'Engine'
config_param :object, :string, default: 'Fluent::Engine'

def configure(conf)
super
if @unix_path
unless ::Fluent::FileUtil.writable?(@unix_path)
raise ConfigError, "in_debug_agent: `#{@unix_path}` is not writable"
raise Fluent::ConfigError, "in_debug_agent: `#{@unix_path}` is not writable"
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/plugin/test_in_debug_agent.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require_relative '../helper'
require 'fluent/test'
require 'fluent/test/driver/input'
require 'fluent/plugin/in_debug_agent'
require 'fileutils'

Expand All @@ -13,7 +13,7 @@ def setup
TMP_DIR = File.expand_path(File.dirname(__FILE__) + "/../tmp/in_debug_agent")

def create_driver(conf = '')
Fluent::Test::InputTestDriver.new(Fluent::DebugAgentInput).configure(conf)
Fluent::Test::Driver::Input.new(Fluent::Plugin::DebugAgentInput).configure(conf)
end

def test_unix_path_writable
Expand Down

0 comments on commit 8262007

Please sign in to comment.