qvm-tools: do not show scary message on --force-root
When this option is used, the user probably already got that message. Also some internal scripts are using this (for example template pre-uninstall script). Conflicts: qvm-tools/qvm-remove
This commit is contained in:
parent
449554f404
commit
acbdb3a261
@ -47,11 +47,8 @@ def main():
|
|||||||
print >> sys.stderr, "A VM with the name '{0}' does not exist in the system.".format(vmname)
|
print >> sys.stderr, "A VM with the name '{0}' does not exist in the system.".format(vmname)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
if hasattr(os, "geteuid") and os.geteuid() == 0:
|
if hasattr(os, "geteuid") and os.geteuid() == 0 and not options.force_root:
|
||||||
print >> sys.stderr, "*** Running this tool as root is strongly discouraged, this will lead you in permissions problems."
|
print >> sys.stderr, "*** Running this tool as root is strongly discouraged, this will lead you in permissions problems."
|
||||||
if options.force_root:
|
|
||||||
print >> sys.stderr, "Continuing as commanded. You have been warned."
|
|
||||||
else:
|
|
||||||
print >> sys.stderr, "Retry as unprivileged user."
|
print >> sys.stderr, "Retry as unprivileged user."
|
||||||
print >> sys.stderr, "... or use --force-root to continue anyway."
|
print >> sys.stderr, "... or use --force-root to continue anyway."
|
||||||
exit(1)
|
exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user