diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-06-04 17:56:12 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-06-04 17:56:12 +0000 |
| commit | 36522d059e05e7634f1e8e9efa59f264e0e0a5ef (patch) | |
| tree | abdefa385f03e003c0f7cb03f7118de938d31ef1 /nova | |
| parent | e6e0bf343f73fb664167f173ef2ae80d39a06540 (diff) | |
| parent | 7d57cc16a6ab3b286e4fd3a479e5b40160980304 (diff) | |
Merge "defensive coding against None inside bdm resolves bug 1007615"
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} |
