From 34f17b90eaefb685828bf49deded6b6555a5699e Mon Sep 17 00:00:00 2001 From: bracker Date: Fri, 18 Jun 2021 21:11:14 -0500 Subject: [PATCH] handle tera usernames more gracefully --- .gitignore | 2 +- .../{tvCopierTemplate.py => tvCopier.py} | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) rename wally-pipelined/linux-testgen/linux-testvectors/{tvCopierTemplate.py => tvCopier.py} (89%) diff --git a/.gitignore b/.gitignore index 9bc8af34..12a94cd9 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,4 @@ testsBP/*/*/*.elf* testsBP/*/OBJ/* testsBP/*/*.a wally-pipelined/linux-testgen/linux-testvectors/* -!wally-pipelined/linux-testgen/linux-testvectors/tvCopierTemplate.py +!wally-pipelined/linux-testgen/linux-testvectors/tvCopier.py diff --git a/wally-pipelined/linux-testgen/linux-testvectors/tvCopierTemplate.py b/wally-pipelined/linux-testgen/linux-testvectors/tvCopier.py similarity index 89% rename from wally-pipelined/linux-testgen/linux-testvectors/tvCopierTemplate.py rename to wally-pipelined/linux-testgen/linux-testvectors/tvCopier.py index 054b325a..262b24b7 100755 --- a/wally-pipelined/linux-testgen/linux-testvectors/tvCopierTemplate.py +++ b/wally-pipelined/linux-testgen/linux-testvectors/tvCopier.py @@ -3,11 +3,14 @@ import os from datetime import datetime -tera = '@tera.eng.hmc.edu' -print("SORRY") -print("This script will fail because you have not set the \'tera\' var to your username") -print("Please make a copy called tvCopier.py") -exit() + +if not os.path.isfile('sshUname.txt'): + print("GREETINGS FRIEND") + print("Please supply your tera username in ./sshUname.txt") + exit(1) +sshUnameFile = open('sshUname.txt','r') +uname = sshUnameFile.readline().strip('\n') +tera = uname+'@tera.eng.hmc.edu' logFile = open('tvCopier.log', 'w') def pyTee(line):