From adcf04255cb24564230604469ae34c180e057dfa Mon Sep 17 00:00:00 2001 From: Theodor van Nahl Date: Aug 06 2019 05:13:37 +0000 Subject: Fix UnboundLocalError in ipa-replica-manage on errors If ipa-replica-manage is unable to retrieve e.g. due to certificate validity problem. An UnboundLocalError is thrown for `type1`. This fixes the issue with a clean exit. Reviewed-By: Christian Heimes --- diff --git a/install/tools/ipa-replica-manage.in b/install/tools/ipa-replica-manage.in index a276239..f4e9494 100644 --- a/install/tools/ipa-replica-manage.in +++ b/install/tools/ipa-replica-manage.in @@ -279,6 +279,7 @@ 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)