fix managed-entries printing IPA not installed

ipa-managed-entries would print "IPA is not configured on this system."
even though this is not true if run as a normal user. Add check for
root running the script.

https://pagure.io/freeipa/issue/6928

Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
This commit is contained in:
Stanislav Laznicka 2017-05-04 09:42:36 +02:00 committed by Tomas Krizek
parent afe85c3798
commit 6522c4a837
No known key found for this signature in database
GPG Key ID: 22A2A94B5E49415A

View File

@ -20,6 +20,7 @@
from __future__ import print_function
import os
import re
import sys
from optparse import OptionParser # pylint: disable=deprecated-module
@ -193,4 +194,6 @@ def main():
return retval
if __name__ == '__main__':
if not os.geteuid() == 0:
sys.exit("\nMust be run as root\n")
installutils.run_script(main, operation_name='ipa-managed-entries')