Pass along user when making virtualenv for backup app

i.e. stop assuming 'root' user for that
This commit is contained in:
Lance Edgar 2019-09-13 19:56:30 -05:00
parent cd421f3aa1
commit 6d9006db9d

View file

@ -80,10 +80,7 @@ def deploy_backup_app(c, deploy, envname, mkvirtualenv=True, user='rattail',
# virtualenv # virtualenv
if mkvirtualenv: if mkvirtualenv:
python.mkvirtualenv(c, envname, python='/usr/bin/python3', python.mkvirtualenv(c, envname, python='/usr/bin/python3', runas_user=user)
# TODO: need to determine if this is safe to add?
# runas_user=user
)
envpath = '/srv/envs/{}'.format(envname) envpath = '/srv/envs/{}'.format(envname)
c.sudo('chown -R {}: {}'.format(user, envpath)) c.sudo('chown -R {}: {}'.format(user, envpath))
mkdir(c, os.path.join(envpath, 'src'), use_sudo=True, runas_user=user) mkdir(c, os.path.join(envpath, 'src'), use_sudo=True, runas_user=user)