1 LinkSpec per link. The array defines more than 1 linkspec.
authorFaiyaz Ahmed <faiyaza@cs.princeton.edu>
Tue, 10 Mar 2009 18:30:39 +0000 (18:30 +0000)
committerFaiyaz Ahmed <faiyaza@cs.princeton.edu>
Tue, 10 Mar 2009 18:30:39 +0000 (18:30 +0000)
vinilinkspec.py

index 5e8911b..d2aeee2 100755 (executable)
@@ -33,7 +33,7 @@ def ifSpecDict(nodedict):
     #            'ip_spoof']
     # Assume only 1 node network per node.
     nodenetwork = GetNodeNetworks(nodedict['nodenetwork_ids'])[0]
-    ifspecs = {'name': nodenetwork['hostname'],
+    ifspec = {'name': nodenetwork['hostname'],
                'addr': nodenetwork['ip'],
                'type': nodenetwork['type'],
                'init_params': None,
@@ -41,7 +41,7 @@ def ifSpecDict(nodedict):
                'min_alloc': 0,
                'max_alloc': '1Gbps',
                'ip_spoof': False}
-    return ifspecs
+    return {'IfSpec': ifspec}
 
 
 def linkSpecDict():
@@ -68,7 +68,7 @@ def linkSpecDict():
         ifspecs = []
         for node in nodeset: 
             ifspecs.append(ifSpecDict(node))
-        linkspecs.append({\
+        linkspecs.append({'LinkSpec': {\
                 'type': 'ipv4',
                 'init_params': None,
                 'bw': '1Gbps',
@@ -76,7 +76,7 @@ def linkSpecDict():
                 'bw': '1Gbps',
                 'endpoints': ifspecs,
                 'start_time': int(time()),
-                'duration': '-1'})
+                'duration': '-1'}})
     return linkspecs