mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add a status option to ipa-acme-manage
It's handy in general and good for testing to be able to detect the current ACME status without having to revert to using curl. https://pagure.io/freeipa/issue/8524 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Fraser Tweedale <ftweedal@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Mohammad Rizwan <myusuf@redhat.com>
This commit is contained in:
@@ -69,11 +69,12 @@ class acme_state(RestClient):
|
||||
class Command(enum.Enum):
|
||||
ENABLE = 'enable'
|
||||
DISABLE = 'disable'
|
||||
STATUS = 'status'
|
||||
|
||||
|
||||
class IPAACMEManage(AdminTool):
|
||||
command_name = "ipa-acme-manage"
|
||||
usage = "%prog [enable|disable]"
|
||||
usage = "%prog [enable|disable|status]"
|
||||
description = "Manage the IPA ACME service"
|
||||
|
||||
def validate_options(self):
|
||||
@@ -108,6 +109,10 @@ class IPAACMEManage(AdminTool):
|
||||
ca_api.enable()
|
||||
elif self.command == Command.DISABLE:
|
||||
ca_api.disable()
|
||||
elif self.command == Command.STATUS:
|
||||
status = "enabled" if dogtag.acme_status() else "disabled"
|
||||
print("ACME is {}".format(status))
|
||||
return 0
|
||||
else:
|
||||
raise RuntimeError('programmer error: unhandled enum case')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user