From: Faiyaz Ahmed Date: Tue, 10 Mar 2009 18:30:39 +0000 (+0000) Subject: 1 LinkSpec per link. The array defines more than 1 linkspec. X-Git-Url: http://git.onelab.eu/?p=nodemanager-topo.git;a=commitdiff_plain;h=b85ce57f4a68f553ba2dd4c368963f80ed5529c7 1 LinkSpec per link. The array defines more than 1 linkspec. --- diff --git a/vinilinkspec.py b/vinilinkspec.py index 5e8911b..d2aeee2 100755 --- a/vinilinkspec.py +++ b/vinilinkspec.py @@ -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