ChainTarget¶
- class ChainTarget(*, chain=None, real_chain_name: Optional[str] = None)[source]¶
This class handles a target that is a chain
At least one of
chain,real_chain_namemust be present. If both are present, the chain’s real name must be equal toreal_chain_name.The target name is set to the real chain name.
- Parameters:
chain – a
Chainobjectreal_chain_name – a string
- resolve_chain(pft, log_failure=True) Chain[source]¶
Resolve the target name to the
Chainobject, and return that object- Parameters:
pft – the
IptablesPacketFilterTableobject that is expected to contain the chainlog_failure – if
Trueand resolution fails, log a warning
- Return type:
a
Chainobject orNone