Skip to content

Commit

Permalink
use power of shell
Browse files Browse the repository at this point in the history
  • Loading branch information
oncilla committed Sep 4, 2019
1 parent 51e5efe commit e862a58
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions python/topology/cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,14 @@ def generate(self, topo_dicts):

def _copy_files(self, topo_dicts):
cp = local['cp']
# Copy the trcs into the AS certs dir.
for topo_id in topo_dicts:
as_dir = local.path(topo_id.base_dir(self.args.output_dir))
for trc in as_dir.dirname // 'trcs/*':
cp('-r', trc, as_dir / 'certs' / trc.name)
# Copy the certs and key dir for all elements.
for topo_id, as_topo, base in srv_iter(
topo_dicts, self.args.output_dir, common=True):
elem_dir = local.path(base)
as_dir = elem_dir.dirname
cp('-r', as_dir / 'certs', elem_dir / 'certs')
cp('-r', as_dir / 'keys', elem_dir / 'keys')
cp(as_dir.dirname / 'trcs' // '*.trc', elem_dir / 'certs')
# Copy the customers dir for all certificate servers.
for topo_id, as_topo in topo_dicts.items():
as_dir = local.path(topo_id.base_dir(self.args.output_dir))
Expand Down

0 comments on commit e862a58

Please sign in to comment.