mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] exit if not run as root instead of raising an obscur exception
This commit is contained in:
parent
c81f098cb2
commit
8a6b31b690
1 changed files with 6 additions and 0 deletions
|
@ -185,6 +185,12 @@ def _retrieve_namespaces():
|
||||||
# Main action ----------------------------------------------------------
|
# Main action ----------------------------------------------------------
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
if os.geteuid() != 0:
|
||||||
|
# since moulinette isn't initialized, we can't use m18n here
|
||||||
|
sys.stderr.write("\033[1;31mError:\033[0m yunohost command must be " \
|
||||||
|
"run as root or with sudo.\n")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
parser, opts, args = _parse_cli_args()
|
parser, opts, args = _parse_cli_args()
|
||||||
_init_moulinette(opts.debug, opts.verbose, opts.quiet)
|
_init_moulinette(opts.debug, opts.verbose, opts.quiet)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue