Skip to content
Snippets Groups Projects
Commit 588a702a authored by hwchiu's avatar hwchiu
Browse files

Merge remote-tracking branch 'upstream/master'

parents b7682aa4 64cd19e5
No related branches found
No related tags found
No related merge requests found
......@@ -94,14 +94,26 @@ if args.action=='add':
result = os.popen(command).read()
parsedResult = json.loads(result)
print command+"\n"
sourceSwitch = parsedResult[0]['attachmentPoint'][0]['switchDPID']
try:
sourceSwitch = parsedResult[0]['attachmentPoint'][0]['switchDPID']
except IndexError:
print "ERROR : the specified end point (%s) must already been known to the controller (i.e., already have sent packets on the network, easy way to assure this is to do a ping (to any target) from the two hosts." % (args.srcAddress)
sys.exit()
sourcePort = parsedResult[0]['attachmentPoint'][0]['port']
command = "curl -s http://%s/wm/device/?ipv4=%s" % (args.controllerRestIp, args.dstAddress)
result = os.popen(command).read()
parsedResult = json.loads(result)
print command+"\n"
destSwitch = parsedResult[0]['attachmentPoint'][0]['switchDPID']
try:
destSwitch = parsedResult[0]['attachmentPoint'][0]['switchDPID']
except IndexError:
print "ERROR : the specified end point (%s) must already been known to the controller (i.e., already have sent packets on the network, easy way to assure this is to do a ping (to any target) from the two hosts." % (args.dstAddress)
sys.exit()
destPort = parsedResult[0]['attachmentPoint'][0]['port']
print "Creating circuit:"
......
......@@ -58,16 +58,10 @@ public class Cluster {
}
void addLink(Link l) {
if (links.containsKey(l.getSrc()) == false) {
links.put(l.getSrc(), new HashSet<Link>());
if (l.getSrc() < id) id = l.getSrc();
}
add(l.getSrc());
links.get(l.getSrc()).add(l);
if (links.containsKey(l.getDst()) == false) {
links.put(l.getDst(), new HashSet<Link>());
if (l.getDst() < id) id = l.getDst();
}
add(l.getDst());
links.get(l.getDst()).add(l);
}
......
......@@ -25,6 +25,7 @@ public class FallbackCCProvider implements IClusterConfigProvider {
AuthScheme authScheme;
String keyStorePath;
String keyStorePassword;
int syncPort = 6642;
public FallbackCCProvider() throws SyncException {
......@@ -43,7 +44,7 @@ public class FallbackCCProvider implements IClusterConfigProvider {
}
return new ClusterConfig(Collections.
singletonList(new Node("localhost",
6642,
syncPort,
Short.MAX_VALUE,
Short.MAX_VALUE)),
Short.MAX_VALUE,
......@@ -61,6 +62,7 @@ public class FallbackCCProvider implements IClusterConfigProvider {
authScheme = AuthScheme.NO_AUTH;
try {
authScheme = AuthScheme.valueOf(config.get("authScheme"));
syncPort = Integer.parseInt(config.get("port"));
} catch (Exception e) {}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment