diff options
| author | Joe Heck <heckj@mac.com> | 2012-06-01 21:51:48 +0000 |
|---|---|---|
| committer | Joe Heck <heckj@mac.com> | 2012-06-01 21:51:48 +0000 |
| commit | 7d57cc16a6ab3b286e4fd3a479e5b40160980304 (patch) | |
| tree | 3f7d6c71d8fa8cdf0b9620c37b185531090b6670 /nova | |
| parent | 18734e9bc7eaf99caea5957618aa77e70c69db81 (diff) | |
defensive coding against None inside bdm
resolves bug 1007615
Change-Id: If7afa4fb030b3c53a0b80737ff792e42cc4d3101
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/compute/manager.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index d9f3ee14f..d6b836360 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -674,10 +674,15 @@ class ComputeManager(manager.SchedulerDependentManager): bdms = self._get_instance_volume_bdms(context, instance_uuid) block_device_mapping = [] for bdm in bdms: - cinfo = jsonutils.loads(bdm['connection_info']) - block_device_mapping.append({'connection_info': cinfo, - 'mount_device': - bdm['device_name']}) + try: + cinfo = jsonutils.loads(bdm['connection_info']) + block_device_mapping.append({'connection_info': cinfo, + 'mount_device': + bdm['device_name']}) + except TypeError: + # if the block_device_mapping has no value in connection_info + # (returned as None), don't include in the mapping + pass # NOTE(vish): The mapping is passed in so the driver can disconnect # from remote volumes if necessary return {'block_device_mapping': block_device_mapping} |
