From b8f56e81dcc7696bb983cfc89a4829d28d4d638b Mon Sep 17 00:00:00 2001 From: Danilo Sousa Date: Tue, 26 Jul 2016 13:37:29 -0300 Subject: only resolve the repository path when the output is `git` fixes #512 --- lib/oxidized/node.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/oxidized') diff --git a/lib/oxidized/node.rb b/lib/oxidized/node.rb index 3e46b17..f2b125a 100644 --- a/lib/oxidized/node.rb +++ b/lib/oxidized/node.rb @@ -22,7 +22,7 @@ module Oxidized @vars = opt[:vars] @stats = Stats.new @retry = 0 - @repo = resolve_repo + @repo = resolve_repo opt # model instance needs to access node instance @model.node = self @@ -171,7 +171,9 @@ module Oxidized Oxidized.mgr.model[model].new end - def resolve_repo + def resolve_repo opt + return unless is_git? opt + remote_repo = Oxidized.config.output.git.repo if remote_repo.is_a?(::String) @@ -185,5 +187,9 @@ module Oxidized end end + def is_git? opt + (opt[:output] || Oxidized.config.output.default) == 'git' + end + end end -- cgit v1.2.1