From e6a3656ab71faea8669af50ceeaf4d9a91fe0142 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 6 May 2015 11:47:46 -0400 Subject: SSSD info plugin is immutable if not preconfigured The SSSD info plugin configures SSSD and modules in Apache as root during installation. This cannot be done in the UI so we must not allow users to modify the state if it was not "preconfigured" during install. If it has been configured then users are allowed to enable/disable the plugin. This is controlled by a value stored in the info_config table, preconfigured. The plugin configuration is hidden from the UI by overridding the get_config_object() method. https://fedorahosted.org/ipsilon/ticket/111 Signed-off-by: Simo Sorce Reviewed-by: Rob Crittenden --- ipsilon/admin/common.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ipsilon/admin/common.py') diff --git a/ipsilon/admin/common.py b/ipsilon/admin/common.py index 743c71c..a85a15d 100644 --- a/ipsilon/admin/common.py +++ b/ipsilon/admin/common.py @@ -282,7 +282,10 @@ class AdminPlugins(AdminPage): except AdminError, e: return self.root_with_msg(str(e), ADMIN_STATUS_WARN) if not obj.is_enabled: - obj.enable() + try: + obj.enable() + except Exception as e: # pylint: disable=broad-except + return self.root_with_msg(str(e), ADMIN_STATUS_WARN) obj.save_enabled_state() msg = "Plugin %s enabled" % obj.name return self.root_with_msg(msg, ADMIN_STATUS_OK, @@ -297,7 +300,10 @@ class AdminPlugins(AdminPage): except AdminError, e: return self.root_with_msg(str(e), ADMIN_STATUS_WARN) if obj.is_enabled: - obj.disable() + try: + obj.disable() + except Exception as e: # pylint: disable=broad-except + return self.root_with_msg(str(e), ADMIN_STATUS_WARN) obj.save_enabled_state() msg = "Plugin %s disabled" % obj.name return self.root_with_msg(msg, ADMIN_STATUS_OK, -- cgit