diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2015-09-21 12:31:18 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-09-23 23:08:50 +0200 |
commit | 669ce24f8157b7d79914b3eb5a18214ef42aacc8 (patch) | |
tree | 0839a29ed8b9688dbaab4cb46a7c837ed72a913d /src/providers/data_provider_fo.c | |
parent | 4c53f8b7400630ae06459aa8b5079427edcaa348 (diff) | |
download | sssd-669ce24f8157b7d79914b3eb5a18214ef42aacc8.tar.gz sssd-669ce24f8157b7d79914b3eb5a18214ef42aacc8.tar.xz sssd-669ce24f8157b7d79914b3eb5a18214ef42aacc8.zip |
FO: Add an API to reset all servers in a single service
Required for:
https://fedorahosted.org/sssd/ticket/2639
Previously, we had a function that allowed the caller to reset the
status of all services in the global fail over context. This patch adds
a new function that allows the caller to reset a single service instead.
The main user would be IPA subdomain provider that might need to reset
the status of an AD trusted domain on demand.
Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/providers/data_provider_fo.c')
-rw-r--r-- | src/providers/data_provider_fo.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/providers/data_provider_fo.c b/src/providers/data_provider_fo.c index 41d70de06..cd57340a0 100644 --- a/src/providers/data_provider_fo.c +++ b/src/providers/data_provider_fo.c @@ -743,6 +743,25 @@ void reset_fo(struct be_ctx *be_ctx) fo_reset_services(be_ctx->be_fo->fo_ctx); } +void be_fo_reset_svc(struct be_ctx *be_ctx, + const char *svc_name) +{ + struct fo_service *service; + int ret; + + DEBUG(SSSDBG_TRACE_LIBS, + "Resetting all servers in service %s\n", svc_name); + + ret = fo_get_service(be_ctx->be_fo->fo_ctx, svc_name, &service); + if (ret != EOK) { + DEBUG(SSSDBG_MINOR_FAILURE, + "Cannot retrieve service [%s]\n", svc_name); + return; + } + + fo_reset_servers(service); +} + void _be_fo_set_port_status(struct be_ctx *ctx, const char *service_name, struct fo_server *server, |