Merge pull request #24 from pyth-network/fix/subprocess

fix: add stdout, err to output
This commit is contained in:
Eran Davidovich 2021-12-24 16:00:53 +02:00 committed by GitHub
commit 82b1cf8fd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -220,7 +220,7 @@ while True:
ATTESTATIONS["pendingSeqnos"].append(seqno)
else:
logging.warn("Warning: Could not get sequence number")
logging.warning("Warning: Could not get sequence number")
time.sleep(P2W_ATTEST_INTERVAL)
nonce += 1

View File

@ -41,7 +41,10 @@ def run_or_die(args, die=True, **kwargs):
ret = subprocess.run(args, text=True, **kwargs)
if ret.returncode != 0:
logging.error(f"Return code is: {ret.returncode}")
if str(ret.stdout) != '':
logging.info(f"STDOUT: {ret.stdout}")
if str(ret.stderr) != '':
logging.error(f"STDERR: {ret.stderr}")
if die:
sys.exit(ret.returncode)
else: