Merge remote-tracking branch 'origin/mueller/update-q7s-script' into mueller/scex-test
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
Robin Müller 2022-02-08 15:00:28 +01:00
commit acfd6bfd5e

View File

@ -49,6 +49,13 @@ def handle_args():
action="store_true", action="store_true",
help="Copy from Q7S to host instead. Always copies to current directory.", help="Copy from Q7S to host instead. Always copies to current directory.",
) )
parser.add_argument(
"-f",
"--flatsat",
default=False,
action="store_true",
help="Copy to flatsat instead"
)
# Positional argument(s) # Positional argument(s)
parser.add_argument( parser.add_argument(
"source", help="Source files to copy or target files to copy back to host" "source", help="Source files to copy or target files to copy back to host"
@ -61,18 +68,21 @@ def build_cmd(args):
cmd = "scp " cmd = "scp "
if args.recursive: if args.recursive:
cmd += "-r " cmd += "-r "
target = args.target if args.flatsat:
if args.invert and target == "": cmd += f"{args.source} eive@flatsat.eive.absatvirt.lw:{target}"
target = "."
elif target == "":
target = f"/tmp"
if args.invert:
cmd += f"-P {args.port} root@localhost:{args.source} {target}"
else: else:
cmd += f"-P {args.port} {args.source} root@localhost:{target}" target = args.target
if args.target: if args.invert and target == "":
cmd += args.target target = "."
return cmd elif target == "":
target = f"/tmp"
if args.invert:
cmd += f"-P {args.port} root@localhost:{args.source} {target}"
else:
cmd += f"-P {args.port} {args.source} root@localhost:{target}"
if args.target:
cmd += args.target
return cmd
if __name__ == "__main__": if __name__ == "__main__":