From 60bf9e3dc02f0f5834e30a8abeb5274763618983 Mon Sep 17 00:00:00 2001 From: Robert Tingirica Date: Tue, 28 Oct 2014 13:07:41 +0200 Subject: [PATCH] Fixed userdata plugin return value for Python3 The comparison fails when ret_value is None in Python3. This adds an extra check so that None will not be compared with an integer. Change-Id: Iddc6bbf42fc3215248d9187725a329181f2ba2fb --- cloudbaseinit/plugins/windows/userdata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbaseinit/plugins/windows/userdata.py b/cloudbaseinit/plugins/windows/userdata.py index fdf77b36..67d30776 100644 --- a/cloudbaseinit/plugins/windows/userdata.py +++ b/cloudbaseinit/plugins/windows/userdata.py @@ -150,7 +150,7 @@ class UserDataPlugin(base.BasePlugin): except (ValueError, TypeError): ret_val = 0 - if ret_val >= 1001 and ret_val <= 1003: + if ret_val and 1001 <= ret_val <= 1003: reboot = bool(ret_val & 1) if ret_val & 2: plugin_status = base.PLUGIN_EXECUTE_ON_NEXT_BOOT