source: trunk/wikifiles/geni-backbone-test/nox-console.patch

Last change on this file was 1185, checked in by Josh Smift, 12 years ago

Added a directory for files for the GENI backbone test, and a nox-console patch from Aaron Rosen that prints output in a nicer format.

File size: 936 bytes
RevLine 
[1185]1--- ./nox/src/scripts/nox-console.py.orig       2012-03-15 23:27:38.000000000 +0000
2+++ ./nox/src/scripts/nox-console.py    2012-03-16 15:23:55.000000000 +0000
3@@ -101,7 +101,25 @@
4     print simplejson.dumps(cmd)
5 sock.send(simplejson.dumps(cmd))
6 if (expectReply):
7-    print simplejson.dumps(simplejson.loads(sock.recv(4096)), indent=4)
8+    data=""
9+    while True:
10+        data += sock.recv(4096)
11+        try:
12+            simplejson.loads(data)
13+            break
14+        except ValueError:
15+            continue
16+     
17+    result= simplejson.loads(data)
18+    for i in result['node_id']:
19+        for j in range (0, 16, 2):
20+            if j == 14:
21+                sys.stdout.write(i.zfill(16)[j] + "" +  i.zfill(16)[j+1]) 
22+            else:
23+                sys.stdout.write((i.zfill(16)[j])+ "" + i.zfill(16)[j+1] + ":")
24+
25+        sys.stdout.write("\n")
26+
27 sock.send("{\"type\":\"disconnect\"}")
28 sock.shutdown(1)
29 sock.close()
Note: See TracBrowser for help on using the repository browser.