Fix command invocation for agent_sudo()

at least, this worked for a recent test...where previous code didn't
This commit is contained in:
Lance Edgar 2020-02-20 17:44:54 -06:00
parent 98a64c5024
commit e290be05c6

View file

@ -45,7 +45,7 @@ def agent_sudo(c, cmd, user=None):
however that you would only want to enable agent forwarding temporarily,
just long enough to e.g. rsync some files.
"""
c.sudo('SSH_AUTH_SOCK=$SSH_AUTH_SOCK {}'.format(cmd), user=user)
c.sudo("bash -c 'SSH_AUTH_SOCK=$SSH_AUTH_SOCK {}'".format(cmd), user=user)
def is_link(c, path, use_sudo=False):