Skip to content

Commit

Permalink
Make SIG IDs in the topology canonical (#2217)
Browse files Browse the repository at this point in the history
All other services are named something like br1-ff00_0_222.
SIG is named sig_1-ff00_0_222. This patch makes the naming consistent.
  • Loading branch information
sustrik authored Dec 11, 2018
1 parent e5db9fa commit 6e999e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions python/topology/docker_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _test_conf(self, topo_id):
# If the tester container needs to communicate to the SIG, it needs the SIG_IP and
# REMOTE_NETS which are the remote subnets that need to be routed through the SIG.
# net information for the connected SIG
sig_net = self.args.networks['sig_%s' % topo_id.file_fmt()][0]
sig_net = self.args.networks['sig%s' % topo_id.file_fmt()][0]
net = self.args.networks[name][0]
bridge = self.args.bridges[net['net']]
entry['networks'][bridge] = {'ipv4_address': str(net['ipv4'])}
Expand All @@ -105,7 +105,7 @@ def _test_conf(self, topo_id):
def _sig_testing_conf(self):
text = ''
for topo_id in self.args.topo_dicts:
ip = self.args.networks['sig_%s' % topo_id.file_fmt()][0]['ipv4']
ip = self.args.networks['sig%s' % topo_id.file_fmt()][0]['ipv4']
text += str(topo_id) + ' ' + str(ip) + '\n'
conf_path = os.path.join(self.args.output_dir, 'sig-testing.conf')
write_file(conf_path, text)
6 changes: 3 additions & 3 deletions python/topology/sig.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def _dispatcher_conf(self, topo_id, base):
]
}

net = self.args.networks['sig_%s' % topo_id.file_fmt()][0]
net = self.args.networks['sig%s' % topo_id.file_fmt()][0]
entry['networks'][self.args.bridges[net['net']]] = {'ipv4_address': str(net['ipv4'])}
self.dc_conf['services']['scion_disp_sig_%s' % topo_id.file_fmt()] = entry
vol_name = 'vol_scion_%sdisp_sig_%s' % (self.prefix, topo_id.file_fmt())
Expand Down Expand Up @@ -125,7 +125,7 @@ def _sig_json(self, topo_id):
if topo_id == t_id:
continue
sig_cfg['ASes'][str(t_id)] = {"Nets": [], "Sigs": {}}
net = self.args.networks['sig_%s' % t_id.file_fmt()][0]
net = self.args.networks['sig%s' % t_id.file_fmt()][0]
sig_cfg['ASes'][str(t_id)]['Nets'].append(net['net'])
sig_cfg['ASes'][str(t_id)]['Sigs']['sig'] = {"Addr": str(net['ipv4'])}

Expand All @@ -134,7 +134,7 @@ def _sig_json(self, topo_id):
write_file(cfg, contents_json + '\n')

def _sig_toml(self, topo_id, topo, base):
name = 'sig_%s' % topo_id.file_fmt()
name = 'sig%s' % topo_id.file_fmt()
net = self.args.networks[name][0]
base = topo_id.base_dir(self.args.output_dir)
log_level = 'trace' if self.args.trace else 'debug'
Expand Down
2 changes: 1 addition & 1 deletion python/topology/topo.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def generate(self):
def _register_sigs(self):
for isd_as, _ in self.args.topo_config_dict["ASes"].items():
topo_id = TopoID(isd_as)
self._reg_addr(topo_id, "sig_" + topo_id.file_fmt())
self._reg_addr(topo_id, "sig" + topo_id.file_fmt())
self._reg_addr(topo_id, "tester_" + topo_id.file_fmt())

def _br_name(self, ep, assigned_br_id, br_ids, if_ids):
Expand Down

0 comments on commit 6e999e2

Please sign in to comment.