mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipalib/util.py: add print_replication_status
Signed-off-by: François Cami <fcami@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
parent
bc3906f9aa
commit
82e32433ed
@ -65,6 +65,7 @@ from ipalib.facts import is_ipa_client_configured
|
|||||||
from ipalib.text import _
|
from ipalib.text import _
|
||||||
from ipaplatform.constants import constants
|
from ipaplatform.constants import constants
|
||||||
from ipaplatform.paths import paths
|
from ipaplatform.paths import paths
|
||||||
|
from ipapython import ipautil
|
||||||
from ipapython.ssh import SSHPublicKey
|
from ipapython.ssh import SSHPublicKey
|
||||||
from ipapython.dn import DN, RDN
|
from ipapython.dn import DN, RDN
|
||||||
from ipapython.dnsutil import (
|
from ipapython.dnsutil import (
|
||||||
@ -1029,6 +1030,31 @@ def has_managed_topology(api):
|
|||||||
return domainlevel > DOMAIN_LEVEL_0
|
return domainlevel > DOMAIN_LEVEL_0
|
||||||
|
|
||||||
|
|
||||||
|
def print_replication_status(entry, verbose):
|
||||||
|
"""Pretty print nsds5replicalastinitstatus, nsds5replicalastinitend,
|
||||||
|
nsds5replicalastupdatestatus, nsds5replicalastupdateend for a
|
||||||
|
replication agreement.
|
||||||
|
"""
|
||||||
|
|
||||||
|
if verbose:
|
||||||
|
initstatus = entry.single_value.get('nsds5replicalastinitstatus')
|
||||||
|
if initstatus is not None:
|
||||||
|
print(" last init status: %s" % initstatus)
|
||||||
|
print(" last init ended: %s" % str(
|
||||||
|
ipautil.parse_generalized_time(
|
||||||
|
entry.single_value['nsds5replicalastinitend'])))
|
||||||
|
updatestatus = entry.single_value.get(
|
||||||
|
'nsds5replicalastupdatestatus'
|
||||||
|
)
|
||||||
|
if updatestatus is not None:
|
||||||
|
print(" last update status: %s" % updatestatus)
|
||||||
|
print(" last update ended: %s" % str(
|
||||||
|
ipautil.parse_generalized_time(
|
||||||
|
entry.single_value['nsds5replicalastupdateend']
|
||||||
|
))
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class classproperty:
|
class classproperty:
|
||||||
__slots__ = ('__doc__', 'fget')
|
__slots__ = ('__doc__', 'fget')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user