diff options
Diffstat (limited to 'lib/oxidized/node.rb')
-rw-r--r-- | lib/oxidized/node.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/oxidized/node.rb b/lib/oxidized/node.rb index 9f729ed..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,15 +171,25 @@ 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 Oxidized.config.output.git.single_repo? || @group.nil? || remote_repo.is_a?(String) - remote_repo + if remote_repo.is_a?(::String) + if Oxidized.config.output.git.single_repo? || @group.nil? + remote_repo + else + File.join(File.dirname(remote_repo), @group + '.git') + end else remote_repo[@group] end end + def is_git? opt + (opt[:output] || Oxidized.config.output.default) == 'git' + end + end end |