Skip to content

Commit 24a116c

Browse files
Reverse changes in iptables and quote comments
1 parent b39aaff commit 24a116c

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

capirca/lib/fortigate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ def __str__(self):
676676
if self._term.owner:
677677
self._term.comment += [f"Owner: {self._term.owner}"]
678678
if self._term.comment and self._term.verbose:
679-
lines += [f"{_SP * 2} set comments {self._obj_container.fix_comment_length((' ').join(self._term.comment))}"]
679+
lines += [f'{_SP * 2} set comments "{self._obj_container.fix_comment_length((" ").join(self._term.comment))}"']
680680
lines += [f"{_SP * 2} set srcintf {self._term.source_interface or 'any'}"]
681681
lines += [f"{_SP * 2} set dstintf {self._term.destination_interface or 'any'}"]
682682
exist_src6 = False

capirca/lib/iptables.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,6 @@ def __str__(self):
227227
if self.term.destination_interface:
228228
destination_interface = self.term.destination_interface
229229

230-
interface = ''
231-
if self.term.interface:
232-
interface = self.term.interface
233-
234230
log_hits = False
235231
if self.term.logging:
236232
# Iptables sends logs to hosts configured syslog
@@ -308,7 +304,6 @@ def __str__(self):
308304
tcp_matcher,
309305
source_interface,
310306
destination_interface,
311-
interface,
312307
log_hits,
313308
self._action_table.get(str(self.term.action[0]))
314309
))
@@ -661,7 +656,6 @@ def _BuildTokens(self):
661656
'destination_prefix',
662657
'fragment_offset',
663658
'icmp_code',
664-
'interface',
665659
'logging',
666660
'log_limit',
667661
'owner',

0 commit comments

Comments
 (0)