mirror of
				https://github.com/Telecominfraproject/ols-ucentral-schema.git
				synced 2025-10-31 18:17:45 +00:00 
			
		
		
		
	schema: fix log generation
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
		| @@ -17,12 +17,15 @@ inputfile.close(); | ||||
| let logs = []; | ||||
|  | ||||
| try { | ||||
| 	let batch = renderer.render(schemareader.validate(inputjson), logs); | ||||
| 	let state = schemareader.validate(inputjson, logs); | ||||
|  | ||||
| 	let batch = state ? renderer.render(state, logs) : ""; | ||||
|  | ||||
| 	fs.stdout.write("Log messages:\n" + join("\n", logs) + "\n\n"); | ||||
|  | ||||
| 	fs.stdout.write("UCI batch output:\n" + batch + "\n"); | ||||
|  | ||||
| 	if (state) { | ||||
| 		let outputjson = fs.open("/tmp/ucentral.uci", "w"); | ||||
| 		outputjson.write(batch); | ||||
| 		outputjson.close(); | ||||
| @@ -43,7 +46,9 @@ try { | ||||
|  | ||||
| 		fs.unlink('/etc/ucentral/ucentral.active'); | ||||
| 		fs.symlink(ARGV[2], '/etc/ucentral/ucentral.active'); | ||||
|  | ||||
| 	} else { | ||||
| 		error = 1; | ||||
| 	} | ||||
| } | ||||
| catch (e) { | ||||
| 	error = 1; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 John Crispin
					John Crispin