def _run_iptables_rules(self): """For some containers we need to add iptables rules added from the config""" block_config = self.config['network-block'] for service, ports in block_config.items(): error, msg = docker_actions.block_ct_ports(service, ports, self.project_name) if error is True: click.secho(msg, fg='red') continue command.verbose(self.context['VERBOSE'], msg)
def _run_iptables_rules(self): """For some containers we need to add iptables rules added from the config.""" block_config = self.config['network-block'] for service, ports in block_config.items(): error, msg = docker.block_ct_ports(service, ports, self.project_name) if error is True: click.secho(msg, fg='red') continue command.verbose(self.context['VERBOSE'], msg)
def _run_iptables_rules(self, cts: dict): """For some containers we need to add iptables rules added from the config.""" for _, ct_info in cts.items(): container = ct_info['compose_name'] ct_config = self.config['services'][container] if 'blocked_ports' not in ct_config: continue blocked_ports = ct_config['blocked_ports'] error, msg = docker.block_ct_ports(container, blocked_ports, self.project_name) if error is True: click.secho(msg, fg='red') continue command.verbose(self.context['VERBOSE'], msg)