Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added current Foreman user as argument to hook script (#47)
  • Loading branch information
wiad authored and sean797 committed Jun 15, 2018
1 parent a021cd3 commit 0a7da89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/foreman_hooks/util.rb
Expand Up @@ -51,6 +51,10 @@ def exec_hook(*args)
end

def exec_hook_int(stdin_data, *args)
# Set environment vars available in hook scripts
# Name of active Foreman user:
ENV['FOREMAN_HOOKS_USER'] = User.current.login

args.map!(&:to_s)
output, status = if Open3.respond_to? :capture2e
Open3.capture2e(*args.push(:stdin_data => stdin_data))
Expand Down

0 comments on commit 0a7da89

Please sign in to comment.