diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-17 08:29:18 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-04-17 08:29:30 +0200 |
commit | 75bc70d1b31593bd8317cb002da6e315d9dc549a (patch) | |
tree | e8325f1df75c22b29c8eb13d3b64f252c7a1c3cf /src | |
parent | ea197c50871bed0cc8ece074f3ca8c1008bf05e9 (diff) | |
download | vyos-1x-75bc70d1b31593bd8317cb002da6e315d9dc549a.tar.gz vyos-1x-75bc70d1b31593bd8317cb002da6e315d9dc549a.zip |
flow-accounting: T2275: fix NameError: name 'stdout' is not defined
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/flow_accounting_conf.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/conf_mode/flow_accounting_conf.py b/src/conf_mode/flow_accounting_conf.py index 8c6a5490d..11df81b1d 100755 --- a/src/conf_mode/flow_accounting_conf.py +++ b/src/conf_mode/flow_accounting_conf.py @@ -82,11 +82,10 @@ def _iptables_get_nflog(): for iptables_variant in ['iptables', 'ip6tables']: # run iptables, save output and split it by lines iptables_command = "sudo {0} -t {1} -S {2}".format(iptables_variant, iptables_nflog_table, iptables_nflog_chain) - cmd(iptables_command, message='Failed to get flows list') - iptables_out = stdout.splitlines() + tmp = cmd(iptables_command, message='Failed to get flows list') # parse each line and add information to list - for current_rule in iptables_out: + for current_rule in tmp.splitlines(): current_rule_parsed = rule_re.search(current_rule) if current_rule_parsed: rules.append({ 'interface': current_rule_parsed.groupdict()["interface"], 'iptables_variant': iptables_variant, 'table': iptables_nflog_table, 'rule_definition': current_rule_parsed.groupdict()["rule_definition"] }) |