autotest: param_parse.py: correct JSON output

This commit is contained in:
Peter Barker 2021-12-20 12:34:13 +11:00 committed by Andrew Tridgell
parent 178ae9e0c1
commit dfa373c1d7
1 changed files with 2 additions and 3 deletions

View File

@ -12,7 +12,6 @@ class JSONEmit(Emit):
json_fname = 'apm.pdef.json'
self.f = open(json_fname, mode='w')
self.content = {"json": {"version": 0}}
self.name = ''
def close(self):
json.dump(self.content, self.f, indent=2, sort_keys=True)
@ -33,7 +32,7 @@ class JSONEmit(Emit):
# Copy content to avoid any modification
g = copy.deepcopy(g)
self.content[self.name] = {}
self.content[g.name] = {}
# Check all params available
for param in g.params:
@ -97,4 +96,4 @@ class JSONEmit(Emit):
# Update main content with actual content
for key in content:
self.content[self.name][key] = content[key]
self.content[g.name][key] = content[key]