You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I notice that chain.rules have no rule that is created with iptc.Rule(chain=chain),
I know we can add a rule by: chain.insert_rule(rule) but its not like it should be there already?
If not why Rule() accept chain argument?
In [1]: import iptc
...: table = iptc.Table("nat")
...: chain = iptc.Chain(table, "PREROUTING")
...: rule = iptc.Rule(chain=chain)
...: print(chain, rule.chain)
...: print(chain.rules, rule)
print_1:
<iptc.ip4tc.Chain object at 0x7f0cdb351390> <iptc.ip4tc.Chain object at 0x7f0cdb351390>
print_2:
[
<iptc.ip4tc.Rule object at 0x7f0cdb351400>,
<iptc.ip4tc.Rule object at 0x7f0cd86d3550>,
<iptc.ip4tc.Rule object at 0x7f0cd86d3710>,
<iptc.ip4tc.Rule object at 0x7f0cd86d3860>
]
<iptc.ip4tc.Rule object at 0x7f0cdb351668>
The text was updated successfully, but these errors were encountered:
I notice that chain.rules have no rule that is created with iptc.Rule(chain=chain),
I know we can add a rule by: chain.insert_rule(rule) but its not like it should be there already?
If not why Rule() accept chain argument?
The text was updated successfully, but these errors were encountered: