Fix BDM legacy usage with objects
When we're doing an upgrade against Havana, our backleveled compute RPC version will cause us to run block_device.legacy_mapping(), which attempts to convert a BlockDeviceMapping object into an old- style dict. This trips over a common problem with objects where things expecting a list or a dict decide the object is a dict and try to iterate it as such. This makes the small tweak necessary and adds a test that verifies that it works. Change-Id: I98fe496720ad1c4fce44c0c7fea8bfa1c2721812
This commit is contained in:
		| @@ -86,7 +86,7 @@ class BlockDeviceDict(dict): | ||||
|         self.update( | ||||
|             dict((field, None) | ||||
|                  for field in self._fields - do_not_default)) | ||||
|         self.update(bdm_dict) | ||||
|         self.update(list(bdm_dict.iteritems())) | ||||
|  | ||||
|     def _validate(self, bdm_dict): | ||||
|         """Basic data format validations.""" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Dan Smith
					Dan Smith