Variable 'update' might be undefined if a plugin configuration cannot be migrated to new format.

Patch attached.
From 3226a3a1753c7d53cc4d03bc4e98085fe18ba316 Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Wed, 6 Jan 2016 20:26:09 +0100
Subject: [PATCH] update_uniqueness plugin: fix referenced before assigment
 error

This error may potentially happen when plugin migration is skipped due
an error. In that case variable 'update' was undefined.
---
 ipaserver/install/plugins/update_uniqueness.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipaserver/install/plugins/update_uniqueness.py b/ipaserver/install/plugins/update_uniqueness.py
index b4c0c81a09c7fa03c7b420fbdc3fd6025636b11b..ea1c6753cdf02f85c595f663b80b615097e931d2 100644
--- a/ipaserver/install/plugins/update_uniqueness.py
+++ b/ipaserver/install/plugins/update_uniqueness.py
@@ -214,8 +214,8 @@ class update_uniqueness_plugins_to_new_syntax(Updater):
                 root_logger.error("Unable to migrate configuration of "
                                   "plugin %s (%s)",
                                   entry.dn, e)
-
-            update_list.append(update)
+            else:
+                update_list.append(update)
 
         return False, update_list
 
-- 
2.5.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to