Skip to content

Commit

Permalink
fused stdout and stderr into a single stream in Vault.push
Browse files Browse the repository at this point in the history
  • Loading branch information
ndenny committed Jun 4, 2024
1 parent 1464830 commit 5f307c9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Bastion/HPSS.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)


#--------------------------------------------------------
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 5f307c9

Please sign in to comment.