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.
reviewable/pr18780/r1
Kei Nohguchi 9 years ago
parent f87f0ec277
commit 14e13f68a5

@ -195,7 +195,7 @@ def main():
updates = dict()
for path, key, new_value, old_value in changeset:
path = '%s.%s' % ('.'.join(path), key)
updates[path] = new_value
updates[path] = str(new_value)
result['updates'] = updates
if changeset:

Loading…
Cancel
Save