Support xyz_update purging metadata
xyz_update's metadata can be added and modified. But if one or multiple key:value was added to metadata, it can't be recovered. This patch support purging metadata. Closes-Bug: 1637177 Change-Id: Id541b209b2e0a67a5243ccc3099ed3f5a8d13460
This commit is contained in:
parent
e418fba7f4
commit
fc59e50981
@ -197,7 +197,7 @@ def print_action_result(rid, res):
|
||||
|
||||
def format_parameters(params, parse_semicolon=True):
|
||||
"""Reformat parameters into dict of format expected by the API."""
|
||||
if not params:
|
||||
if not params or params == ['{}']:
|
||||
return {}
|
||||
|
||||
if parse_semicolon:
|
||||
|
@ -50,6 +50,10 @@ class shellTest(testtools.TestCase):
|
||||
self.assertEqual(format_params,
|
||||
utils.format_parameters(params))
|
||||
|
||||
def test_format_parameter_none_dict(self):
|
||||
params = ['{}']
|
||||
self.assertEqual({}, utils.format_parameters(params))
|
||||
|
||||
def test_format_parameter_none(self):
|
||||
self.assertEqual({}, utils.format_parameters(None))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user