ops_template.py: Change integer key into stirng
This fix passing the update variable to the str() so that it avoids the exception when ops.dc.read() returns a dictionary which contains non-string keys. This is due to the fact that some of the key types in OpenSwitch schema are actually defined as integer and ops.dc declerative config module encode those in integer inside the dictionary. This could be the right encoding from the schema point of view but someone needs to convert it to the string somewhere, as JSON key should be string.
This commit is contained in:
parent
ff1c591c3e
commit
d738ad0ee0
1 changed files with 1 additions and 1 deletions
|
@ -195,7 +195,7 @@ def main():
|
||||||
updates = dict()
|
updates = dict()
|
||||||
for path, key, new_value, old_value in changeset:
|
for path, key, new_value, old_value in changeset:
|
||||||
path = '%s.%s' % ('.'.join(path), key)
|
path = '%s.%s' % ('.'.join(path), key)
|
||||||
updates[path] = new_value
|
updates[path] = str(new_value)
|
||||||
result['updates'] = updates
|
result['updates'] = updates
|
||||||
|
|
||||||
if changeset:
|
if changeset:
|
||||||
|
|
Loading…
Reference in a new issue