mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipatests: Extend clear_sssd_cache to support non-systemd platforms
Part of: https://fedorahosted.org/freeipa/ticket/3833
This commit is contained in:
committed by
Petr Viktorin
parent
57ccee4eae
commit
775f2de4ec
@@ -374,12 +374,22 @@ def clear_sssd_cache(host):
|
|||||||
Clears SSSD cache by removing the cache files. Restarts SSSD.
|
Clears SSSD cache by removing the cache files. Restarts SSSD.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
host.run_command(['systemctl', 'stop', 'sssd'])
|
systemd_available = host.transport.file_exists('/bin/systemctl')
|
||||||
host.run_command(['rm', '-rfv', '/var/lib/sss/db/cache_%s.ldb'
|
|
||||||
% host.domain.name])
|
if systemd_available:
|
||||||
host.run_command(['rm', '-rfv', '/var/lib/sss/mc/group'])
|
host.run_command(['systemctl', 'start', 'sssd'])
|
||||||
host.run_command(['rm', '-rfv', '/var/lib/sss/mc/passwd'])
|
else:
|
||||||
host.run_command(['systemctl', 'start', 'sssd'])
|
host.run_command(['/sbin/service', 'sssd', 'start'])
|
||||||
|
|
||||||
|
host.run_command("find /var/lib/sss/db -name '*.ldb' | "
|
||||||
|
"xargs rm -fv")
|
||||||
|
host.run_command(['rm', '-fv', '/var/lib/sss/mc/group'])
|
||||||
|
host.run_command(['rm', '-fv', '/var/lib/sss/mc/passwd'])
|
||||||
|
|
||||||
|
if systemd_available:
|
||||||
|
host.run_command(['systemctl', 'start', 'sssd'])
|
||||||
|
else:
|
||||||
|
host.run_command(['/sbin/service', 'sssd', 'start'])
|
||||||
|
|
||||||
|
|
||||||
def sync_time(host, server):
|
def sync_time(host, server):
|
||||||
|
|||||||
Reference in New Issue
Block a user