Merge "Consider lc string for bootable True/False"

This commit is contained in:
Jenkins
2013-09-21 15:53:04 +00:00
committed by Gerrit Code Review

View File

@@ -65,9 +65,14 @@ class VolumesClientXML(RestClientXML):
Check if the volume is bootable, also change the value Check if the volume is bootable, also change the value
of 'bootable' from string to boolean. of 'bootable' from string to boolean.
""" """
if volume['bootable'] == 'True':
# NOTE(jdg): Version 1 of Cinder API uses lc strings
# We should consider being explicit in this check to
# avoid introducing bugs like: LP #1227837
if volume['bootable'].lower() == 'true':
volume['bootable'] = True volume['bootable'] = True
elif volume['bootable'] == 'False': elif volume['bootable'].lower() == 'false':
volume['bootable'] = False volume['bootable'] = False
else: else:
raise ValueError( raise ValueError(