summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2011-05-27 11:07:24 +0900
committerIsaku Yamahata <yamahata@valinux.co.jp>2011-05-27 11:07:24 +0900
commitb802f28c0b24a04e7c12f44d18e90792ce9ee13b (patch)
tree2b3baeebb5e8bb234c9880589dca7e015fecfb16 /nova
parentd380729b162c8d6120279db74327e61a4942e28f (diff)
api/ec2: make ec2 api accept true/false
ec2 block device mapping api uses 'true'/'false', not 'True'/'False'. So teach ec2 api parser case insensitive true/false conversion.
Diffstat (limited to 'nova')
-rw-r--r--nova/api/ec2/apirequest.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/api/ec2/apirequest.py b/nova/api/ec2/apirequest.py
index 6672e60bb..94900dfbd 100644
--- a/nova/api/ec2/apirequest.py
+++ b/nova/api/ec2/apirequest.py
@@ -59,8 +59,8 @@ def _try_convert(value):
============= =====================================================
zero-length ''
'None' None
- 'True' True
- 'False' False
+ 'True' True case insensitive
+ 'False' False case insensitive
'0', '-0' 0
0xN, -0xN int from hex (postitive) (N is any number)
0bN, -0bN int from binary (positive) (N is any number)
@@ -71,9 +71,9 @@ def _try_convert(value):
return ''
if value == 'None':
return None
- if value == 'True':
+ if value.lower() == 'true':
return True
- if value == 'False':
+ if value.lower() == 'false':
return False
valueneg = value[1:] if value[0] == '-' else value
if valueneg == '0':