|
@@ -30,8 +30,13 @@ def create_json(manifestfile, pubkeysfile, nodelist):
|
|
|
pubkeys = yaml.safe_load(pf)
|
|
|
if nodelist is None or len(nodelist) == 0:
|
|
|
nodelist = manifest.keys()
|
|
|
- config = []
|
|
|
+ config = {}
|
|
|
+ if "params" in nodelist:
|
|
|
+ config['params'] = manifest['params']
|
|
|
+ config['nodes'] = []
|
|
|
for node in nodelist:
|
|
|
+ if node == "params":
|
|
|
+ continue
|
|
|
nodeconf = {}
|
|
|
m = manifest[node]
|
|
|
nodeconf['name'] = node
|
|
@@ -41,7 +46,7 @@ def create_json(manifestfile, pubkeysfile, nodelist):
|
|
|
for f in ['clisten', 'weight']:
|
|
|
if f in m:
|
|
|
nodeconf[f] = m[f]
|
|
|
- config.append(nodeconf)
|
|
|
+ config['nodes'].append(nodeconf)
|
|
|
return json.dumps(config)
|
|
|
|
|
|
if __name__ == "__main__":
|