Use parse_known_args when checking iptables rules

This will allow use of iptables custom extensions

Fixes #50014
This commit is contained in:
Daniel Wallace 2018-10-12 09:52:48 -05:00
parent 15f86b2c69
commit e552e4f268
No known key found for this signature in database
GPG Key ID: 5FA5E5544F010D48

View File

@ -1026,11 +1026,8 @@ def _parse_conf(conf_file=None, in_mem=False, family='ipv4'):
if args[-1].startswith('-'):
args.append('')
parsed_args = []
if sys.version.startswith('2.6'):
(opts, leftover_args) = parser.parse_args(args)
parsed_args = vars(opts)
else:
parsed_args = vars(parser.parse_args(args))
opts, _ = parser.parse_known_args(args)
parsed_args = vars(opts)
ret_args = {}
chain = parsed_args['append']
for arg in parsed_args: