/ / Usando Fabric in Python, provando ad eseguire comandi tsch sul server bash remoto - python, unix, fabric

Usando Fabric in Python, provando ad eseguire comandi tsch sul server bash remoto - python, unix, fabric

Scusa se quel titolo è confuso. Sto eseguendo uno script python remoto sulla rete locale usando Fabric:

#Path to file being run
env.source = "c/yadda/yadda"
env.file = "run_tests.py"
env.set = "source ~USERNAME/ENVIRONMENT"

#create the task of changing the directory and running the test file from there
def link():
print("Connecting to remote computer and setting envirnoment...")
run ("%s" % env.set)
run ("cd %s && ./%s" % (env.source, env.file))


--- The env.set is used to bring the Python version up to a more recent version so that the file commands work (open with was causing problems).

IL PROBLEMA è che env.set ha comandi tsch come setenv che, quando vengono eseguiti nella shell Bash, danno errori. C'è un modo in cui posso scrivere quanto sopra per incorporare i comandi tsch?

risposte:

0 per risposta № 1

Non importa se l'ho risolto io :)

Impostazione in alto:

env.shell = "/bin/rbash -l -c"

Ho risolto questo problema ambientale.