From 5f307c9702669da763d7ec39272d44af90bcea21 Mon Sep 17 00:00:00 2001 From: Nathan Denny Date: Tue, 4 Jun 2024 04:44:00 -0400 Subject: [PATCH] fused stdout and stderr into a single stream in Vault.push --- lib/Bastion/HPSS.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Bastion/HPSS.py b/lib/Bastion/HPSS.py index 5e0304a..c8ab782 100644 --- a/lib/Bastion/HPSS.py +++ b/lib/Bastion/HPSS.py @@ -5,11 +5,13 @@ import datetime import json import socket +import logging from Bastion.Common import Thing, Unknown import Bastion.Model from Bastion.Curator import BLONDE +logger = logging.getLogger(__name__) #-------------------------------------------------------- @@ -445,9 +447,12 @@ def push(self, asset, **kwargs): } comargs = [str(opts['htar']), "-c", "-f", "{site}/{zone}/{asset}/{blonde}.tar".format(**opts), "-v", "-Hverify=1", "{localf}".format(**opts)] - proc = subprocess.run(comargs, capture_output = True, check = False, env = exports) + proc = subprocess.run(comargs, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, check = False, env = exports) stdout = proc.stdout.decode('utf-8') - stderr = proc.stderr.decode('utf-8') +# stderr = proc.stderr.decode('utf-8') + stderr = stdout + for line in stdout.split('\n'): + logger.info(line) flag = True if (proc.returncode == 0) else False return (flag, stdout, stderr)