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
This commit is contained in:
parent
0c466e1077
commit
60bf9e3dc0
@ -150,7 +150,7 @@ class UserDataPlugin(base.BasePlugin):
|
|||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
ret_val = 0
|
ret_val = 0
|
||||||
|
|
||||||
if ret_val >= 1001 and ret_val <= 1003:
|
if ret_val and 1001 <= ret_val <= 1003:
|
||||||
reboot = bool(ret_val & 1)
|
reboot = bool(ret_val & 1)
|
||||||
if ret_val & 2:
|
if ret_val & 2:
|
||||||
plugin_status = base.PLUGIN_EXECUTE_ON_NEXT_BOOT
|
plugin_status = base.PLUGIN_EXECUTE_ON_NEXT_BOOT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user