From 03e8ce155031f5fb60ed63682063ade567ac81de Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Tue, 13 Nov 2018 12:28:41 -0800 Subject: [PATCH] Exit when tljh-config is called as non-root - Previously, we only printed warning and did not exit - Split the warning over two lines rather than one - -E is not required for tljh-config anymore (since it is in /usr/bin, not /usr/local/bin), so do not ask users to use it. https://github.com/jupyterhub/the-littlest-jupyterhub/pull/135 is the PR that made this change, and changed documentation in most places. --- tljh/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tljh/config.py b/tljh/config.py index 9c862d5..81d6b8e 100644 --- a/tljh/config.py +++ b/tljh/config.py @@ -219,7 +219,9 @@ def _is_list(item): def main(argv=None): if os.geteuid() != 0: - print("It looks like this command wasn't run with root privileges. Perhaps you didn't use `sudo -E`?") + print("tljh-config needs root privileges to run", file=sys.stderr) + print("Try using sudo before the tljh-config command you wanted to run", file=sys.stderr) + sys.exit(1) if argv is None: argv = sys.argv[1:]