mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Merge pull request #209 from anyushevai/non-root
add warning if tljh-config is called as non-root user
This commit is contained in:
@@ -219,11 +219,18 @@ 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`?")
|
||||
|
||||
if argv is None:
|
||||
argv = sys.argv[1:]
|
||||
|
||||
from .log import init_logging
|
||||
try:
|
||||
init_logging()
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
print("Perhaps you didn't use `sudo -E`?")
|
||||
|
||||
argparser = argparse.ArgumentParser()
|
||||
argparser.add_argument(
|
||||
|
||||
Reference in New Issue
Block a user