diff options
| author | ytti <saku@ytti.fi> | 2016-07-28 10:34:03 +0300 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-28 10:34:03 +0300 | 
| commit | 7d0dba17675a9c432189ec50584f5f449801f7d7 (patch) | |
| tree | 5004f4b3aec877c12903999242c400b2e198df84 /lib/oxidized | |
| parent | c6246680d2cb524cba36d414411f6546224130e3 (diff) | |
| parent | b8f56e81dcc7696bb983cfc89a4829d28d4d638b (diff) | |
Merge pull request #513 from danilopopeye/512-fix-resolve_repo-crash
only resolve the repository path when the output is `git`
Diffstat (limited to 'lib/oxidized')
| -rw-r--r-- | lib/oxidized/node.rb | 10 | 
1 files changed, 8 insertions, 2 deletions
| 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 | 
