From 911d578e37fe953a4e585c5a734f719e3e55bd99 Mon Sep 17 00:00:00 2001
From: German Parente <gparente@redhat.com>
Date: Mon, 1 Oct 2018 17:39:20 +0200
Subject: [PATCH] diffs for freeipa 7716

---
 install/tools/ipa-csreplica-manage.in | 10 +++++-----
 install/tools/ipa-replica-manage.in   |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/install/tools/ipa-csreplica-manage.in b/install/tools/ipa-csreplica-manage.in
index b9ad3775e7..6988810464 100644
--- a/install/tools/ipa-csreplica-manage.in
+++ b/install/tools/ipa-csreplica-manage.in
@@ -135,11 +135,11 @@ def list_replicas(realm, host, replica, dirman_passwd, verbose):
         print('%s' % entry.single_value.get('nsds5replicahost'))
 
         if verbose:
-            print("  last init status: %s" % entry.single_value.get(
-                'nsds5replicalastinitstatus'))
-            print("  last init ended: %s" % str(
-                ipautil.parse_generalized_time(
-                    entry.single_value['nsds5replicalastinitend'])))
+            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 update status: %s" % entry.single_value.get(
                 'nsds5replicalastupdatestatus'))
             print("  last update ended: %s" % str(
diff --git a/install/tools/ipa-replica-manage.in b/install/tools/ipa-replica-manage.in
index d69f5ef393..8011b3d364 100644
--- a/install/tools/ipa-replica-manage.in
+++ b/install/tools/ipa-replica-manage.in
@@ -240,10 +240,10 @@ def list_replicas(realm, host, replica, dirman_passwd, verbose, nolookup=False):
         print('%s: %s' % (entry.single_value.get('nsds5replicahost'), ent_type))
 
         if verbose:
-            print("  last init status: %s" % entry.single_value.get(
-                'nsds5replicalastinitstatus'))
-            print("  last init ended: %s" % str(ipautil.parse_generalized_time(
-                entry.single_value['nsds5replicalastinitend'])))
+            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(
             print("  last update status: %s" % entry.single_value.get(
                 'nsds5replicalastupdatestatus'))
             print("  last update ended: %s" % str(
