ipa-cert-fix: use customary exit statuses

It is customary to return 2 when IPA is not configured, and 1 when
other required bits are not installed or configured.  Update
ipa-cert-fix exit statuses accordingly.

Part of: https://pagure.io/freeipa/issue/7885

Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
Fraser Tweedale 2019-03-29 16:04:20 +11:00
parent a9f09fee56
commit e41b7457f3

View File

@ -71,11 +71,11 @@ class IPACertFix(AdminTool):
def run(self):
if not is_ipa_configured():
print("IPA is not configured.")
return 0 # not really an error
return 2
if not cainstance.is_ca_installed_locally():
print("CA is not installed on this server.")
return 0 # not really an error
return 1
try:
ipautil.run(['pki-server', 'cert-fix', '--help'], raiseonerr=True)