From 8880188001da23a5f0960e3970c4eb9bbd448306 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Sun, 23 Feb 2014 19:11:29 +0200 Subject: Migrate to sinatra/puma from webrick As I can't do IO#select on sinatra/puma to run it when I have time, I have to run it on separate thread. This means Nodes container needs to be thread safe, it now has ghetto mutex locking, but I probably need to be be more focused what are the external methods that can be called and wrap those in @mutex.synchronize Provide also HTML UI not just JSON for ghetto UI to people who don't want to integrate --- lib/oxidized/input/cli.rb | 6 +++--- lib/oxidized/input/ssh.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/oxidized/input') diff --git a/lib/oxidized/input/cli.rb b/lib/oxidized/input/cli.rb index 8daddac..ab93b06 100644 --- a/lib/oxidized/input/cli.rb +++ b/lib/oxidized/input/cli.rb @@ -1,7 +1,7 @@ module Oxidized class Input module CLI - + def initialize @post_login = [] @pre_logout = [] @@ -17,13 +17,13 @@ module Oxidized def disconnect_cli @pre_logout.each { |command, block| block ? block.call : (cmd command) } end - + def post_login _post_login=nil, &block unless @exec @post_login << [_post_login, block] end end - + def pre_logout _pre_logout=nil, &block unless @exec @pre_logout << [_pre_logout, block] diff --git a/lib/oxidized/input/ssh.rb b/lib/oxidized/input/ssh.rb index 67be180..5c9a4f0 100644 --- a/lib/oxidized/input/ssh.rb +++ b/lib/oxidized/input/ssh.rb @@ -77,7 +77,7 @@ module Oxidized expect expect_re if expect_re @output end - + def expect regexp @ssh.loop(0.1) do sleep 0.1 -- cgit v1.2.1