Fix location update

After commit Ieb03aaba887492819f9c58aa67f7acfcea81720e, the command
location-update is totally broken now. This patch removes the updating
for an image from non-empty to empty since it's not supported now.
And also removing the default value of metadata for location-update
cli command because now the only purpose of location-update is updating
the location's metadata, so it doesn't make sense to give it a default
value which may update existing metadata by mistake.

Closes-Bug: #1537626

Change-Id: I9ce98e6c63996bbfdbc56761055e37a871f9d3e2
This commit is contained in:
Fei Long Wang
2016-02-15 16:39:03 +13:00
committed by Flavio Percoco
parent c58b4cc984
commit 8b6dbb2065
3 changed files with 8 additions and 9 deletions
@@ -1091,8 +1091,6 @@ class TestController(testtools.TestCase):
loc_map = dict([(l['url'], l) for l in orig_locations])
loc_map[new_loc['url']] = new_loc
mod_patch = [{'path': '/locations', 'op': 'replace',
'value': []},
{'path': '/locations', 'op': 'replace',
'value': list(loc_map.values())}]
self.controller.update_location(image_id, **new_loc)
self.assertEqual(self.api.calls, [