Commit e8d32fba authored by David Johnson's avatar David Johnson

Fix some bugs in the allpairs wfagent so it actually works.

(Did I even test this thing?  What the heck.)
parent 4525c033
Pipeline #1148 skipped
......@@ -3,8 +3,8 @@ import time
#import argparse
#from pprint import pprint
from collections import namedtuple
import traceback
import capnet.capnet_cp_pb2 as cn_pb
import capnet.capnet as cn
Entry = namedtuple("Entry", ["node", "info", "rp", "flow"])
......@@ -17,16 +17,18 @@ def main():
print "getting rp0"
rp0 = p.rp0()
me = None
myname = None
# The wfagent cap comes to us first, after rp0.
print "rp0 recv me"
me = rp0.recv()
print "node info"
info = node.info()
info = me.info()
print "node flow"
flow = node.flow()
me = info.name
nodes[info.name] = Entry(node,info,node_rp,flow)
flow = me.flow()
node_rp = p.create(cn.RP)
nodes[info.name] = Entry(me,info,node_rp,flow)
myname = info.name
# Now receive node caps forever, and grant flows from us to everyone
# else, and vice versa.
......@@ -54,7 +56,7 @@ def main():
a = nodes[name]
for (bname,b) in nodes.iteritems():
# Don't give caps to send to us.
if node.info.name == me:
if b.info.name == me:
continue
print "Sending flow ->%s to %s" % (b.info.name,name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment