jeudi 21 juillet 2016

Using raw string properly to send commands over SSH in Python

I have a long long command to send over SSH using Paramiko and I need to wrap the string using "r" parameter but the IDE still tells me it's not written fine. The string is something like that:

somecommand get -n somestuff sa/management --template='{{range .secrets}}{{printf "%sn" .name}}{{end}}'

I tried doing:

command = r'somecommand get -n somestuff sa/management --template='{{range .secrets}}{{printf "%sn" .name}}{{end}}'

But got an error. This is probably something super easy to do....

Aucun commentaire:

Enregistrer un commentaire