Page MenuHomePhabricator

Improve user check behaviour in virtualenv_activate
Closed, ResolvedPublic

Description

Some of the tool's shell scripts need to be run as the www user and some not.

virtualenv_activate.sh checks that the current user is the correct one and if not, runs exit 1. Because we've sourced this script, exit 1 quits the session entirely, booting the user out of vagrant ssh. We shouldn't do this, but should retain the behaviour of providing the helpful error message and quitting the script(s) being run.

Event Timeline

Samwalton9-WMF moved this task from Planned to Open tasks on the Library-Card-Platform board.
Samwalton9-WMF renamed this task from Improve user behaviour of shell scripts to Improve user check behaviour in virtualenv_activate.Jan 3 2019, 2:41 PM
Samwalton9-WMF updated the task description. (Show Details)

The task as originally written was already the case - virtualenv_activate.sh checks the user. However, when it exits it quits vagrant ssh too. Changing task scope.

This is a super simple fix. I'll get it pushed right in.

So, while fixing this problem in a branch, I encountered/reproduced the originally reported issue. The scripts that directly use a virtualenv do in fact have the user check thanks to the virualenv_activate script. Some of the wrapper scripts that compose those into useful workflows don't because the test for the "right thing" needs to be a little more complicated.

jsn.sherman claimed this task.

fix merged into master