Skip to content

Commit

Permalink
build-log: call post-log-hook for possible logs uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Dec 6, 2016
1 parent 43b1221 commit f7fa9db
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rpc-services/qubesbuilder.BuildLog
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import sys
import os
import errno
import shutil
import subprocess
from datetime import datetime

def sanitize_line(untrusted_line):
Expand Down Expand Up @@ -85,3 +86,13 @@ while True:
break

shutil.move(tmp_log.name, file_name)

# at the end execute post-log-hook if exists, for possible log uploading
hook_path = '{}/QubesIncomingBuildLog/post-log-hook'.\
format(os.getenv('HOME', '/'))
if os.path.exists(hook_path):
# connect I/O to /dev/null, as we're running as qrexec service, so that
# would be sent to the remote domain
subprocess.check_call([hook_path, file_name],
stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w'),
stdin=open(os.devnull, 'r'))

0 comments on commit f7fa9db

Please sign in to comment.