From fb2d7d5ce2a8b7f07dcb3e4fcccf4abdd915da77 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Sat, 12 Apr 2014 19:15:58 +0300 Subject: allow running post_login separately --- lib/oxidized/input/cli.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/oxidized/input/cli.rb b/lib/oxidized/input/cli.rb index 2e6ac35..22d188c 100644 --- a/lib/oxidized/input/cli.rb +++ b/lib/oxidized/input/cli.rb @@ -9,12 +9,16 @@ module Oxidized end def get - @post_login.each { |command, block| block ? block.call : (cmd command) } + connect_cli d = @node.model.get disconnect d end + def connect_cli + @post_login.each { |command, block| block ? block.call : (cmd command) } + end + def disconnect_cli @pre_logout.each { |command, block| block ? block.call : (cmd command, nil) } end -- cgit v1.2.1