Change the return codes of ipa-acme-manage

Traditionally in IPA 0 = success, 1 = error and then
specific error messages follow from that. Shift the
ipa-acme-manage return codes for "not installed" and
"not a CA" up by one.

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

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
Reviewed-By: Mohammad Rizwan <myusuf@redhat.com>
This commit is contained in:
Rob Crittenden
2020-11-02 14:01:05 -05:00
parent 2768b0dbaf
commit e0ff82c884
3 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -31,6 +31,8 @@ Display the status of the ACME service.
.SH "EXIT STATUS"
0 if the command was successful
1 if the host is not a CA server
1 if an error occurred
2 if the host is not a FreeIPA server
3 if the host is not a CA server
+1 -1
View File
@@ -104,7 +104,7 @@ class IPAACMEManage(AdminTool):
if not cainstance.is_ca_installed_locally():
print("CA is not installed on this server.")
return 1
return 3
api.bootstrap(in_server=True, confdir=paths.ETC_IPA)
api.finalize()
+1 -1
View File
@@ -327,7 +327,7 @@ class TestACMECALess(IntegrationTest):
# check status of acme on replica, result: CA is not installed
result = self.replicas[0].run_command(['ipa-acme-manage', 'status'],
raiseonerr=False)
assert result.returncode == 1
assert result.returncode == 3
# Install CA on replica
tasks.install_ca(self.replicas[0])