Imported Debian patch 4.7.2-3
This commit is contained in:
committed by
Mario Fetka
parent
27edeba051
commit
8bc559c5a1
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python3
|
||||
@PYTHONSHEBANG@
|
||||
# Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
|
||||
#
|
||||
# Copyright (C) 2007 Red Hat
|
||||
@@ -23,13 +23,16 @@ from __future__ import print_function
|
||||
import logging
|
||||
import sys
|
||||
import os
|
||||
|
||||
import re
|
||||
import ldap
|
||||
import socket
|
||||
import traceback
|
||||
from urllib.parse import urlparse
|
||||
from xmlrpc.client import MAXINT
|
||||
|
||||
import ldap
|
||||
# pylint: disable=import-error
|
||||
from six.moves.urllib.parse import urlparse
|
||||
from six.moves.xmlrpc_client import MAXINT
|
||||
# pylint: enable=import-error
|
||||
|
||||
from ipaclient.install import ipadiscovery
|
||||
from ipapython import ipautil
|
||||
@@ -236,19 +239,16 @@ def list_replicas(realm, host, replica, dirman_passwd, verbose, nolookup=False):
|
||||
print('%s: %s' % (entry.single_value.get('nsds5replicahost'), ent_type))
|
||||
|
||||
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'])))
|
||||
print(" last init status: %s" % entry.single_value.get(
|
||||
'nsds5replicalastinitstatus'))
|
||||
print(" last init ended: %s" % str(ipautil.parse_generalized_time(
|
||||
entry.single_value['nsds5replicalastinitend'])))
|
||||
print(" last update status: %s" % entry.single_value.get(
|
||||
'nsds5replicalastupdatestatus'))
|
||||
print(" last update ended: %s" % str(
|
||||
ipautil.parse_generalized_time(
|
||||
entry.single_value['nsds5replicalastupdateend'])))
|
||||
|
||||
|
||||
def del_link(realm, replica1, replica2, dirman_passwd, force=False):
|
||||
"""
|
||||
Delete a replication agreement from host A to host B.
|
||||
@@ -279,7 +279,6 @@ def del_link(realm, replica1, replica2, dirman_passwd, force=False):
|
||||
return False
|
||||
except Exception as e:
|
||||
print("Failed to determine agreement type for '%s': %s" % (replica2, e))
|
||||
return False
|
||||
|
||||
if type1 == replication.IPA_REPLICA and managed_topology:
|
||||
exit_on_managed_topology(what)
|
||||
@@ -1222,6 +1221,7 @@ def re_initialize(realm, thishost, fromhost, dirman_passwd, nolookup=False):
|
||||
# we did not replicate memberOf, do so now.
|
||||
if not agreement.single_value.get('nsDS5ReplicatedAttributeListTotal'):
|
||||
ds = dsinstance.DsInstance(realm_name=realm)
|
||||
ds.ldapi = os.getegid() == 0
|
||||
ds.init_memberof()
|
||||
|
||||
def force_sync(realm, thishost, fromhost, dirman_passwd, nolookup=False):
|
||||
@@ -1241,11 +1241,12 @@ def force_sync(realm, thishost, fromhost, dirman_passwd, nolookup=False):
|
||||
repl.force_sync(repl.conn, fromhost)
|
||||
else:
|
||||
ds = dsinstance.DsInstance(realm_name=realm)
|
||||
ds.ldapi = os.getegid() == 0
|
||||
ds.replica_manage_time_skew(prevent=False)
|
||||
repl = replication.ReplicationManager(realm, fromhost, dirman_passwd)
|
||||
repl.force_sync(repl.conn, thishost)
|
||||
agreement = repl.get_replication_agreement(thishost)
|
||||
repl.wait_for_repl_update(repl.conn, agreement.dn)
|
||||
repl.wait_for_repl_init(repl.conn, agreement.dn)
|
||||
ds.replica_manage_time_skew(prevent=True)
|
||||
|
||||
def show_DNA_ranges(hostname, master, realm, dirman_passwd, nextrange=False,
|
||||
|
||||
Reference in New Issue
Block a user