diff options
author | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-04-05 17:46:32 +0100 |
---|---|---|
committer | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-04-06 20:22:35 +0100 |
commit | 787016f1bb590b0e001462b80eb00482c2148746 (patch) | |
tree | 2c8c4135b76a94e9eb2ff2bf3a104ced606ccf42 /src/helpers/vyos-bridge-sync.py | |
parent | 6057aff92b7961945ed21628c5185d5fe01f57a4 (diff) | |
download | vyos-1x-787016f1bb590b0e001462b80eb00482c2148746.tar.gz vyos-1x-787016f1bb590b0e001462b80eb00482c2148746.zip |
util: T2226: rewrite bridge to use cmd (see comment in code)
Diffstat (limited to 'src/helpers/vyos-bridge-sync.py')
-rwxr-xr-x | src/helpers/vyos-bridge-sync.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/helpers/vyos-bridge-sync.py b/src/helpers/vyos-bridge-sync.py index 495eb5d40..097d28d85 100755 --- a/src/helpers/vyos-bridge-sync.py +++ b/src/helpers/vyos-bridge-sync.py @@ -21,16 +21,12 @@ # to the bridge automatically once it's available import argparse -import subprocess - from sys import exit from time import sleep + from vyos.config import Config +from vyos.util import cmd, run -def subprocess_cmd(command): - process = subprocess.Popen(command,stdout=subprocess.PIPE, shell=True) - proc_stdout = process.communicate()[0].strip() - pass if __name__ == '__main__': parser = argparse.ArgumentParser() @@ -45,9 +41,11 @@ if __name__ == '__main__': for bridge in conf.list_nodes('interfaces bridge'): for member_if in conf.list_nodes('interfaces bridge {} member interface'.format(bridge)): if args.interface == member_if: - cmd = 'brctl addif "{}" "{}"'.format(bridge, args.interface) + command = 'brctl addif "{}" "{}"'.format(bridge, args.interface) # let interfaces etc. settle - especially required for OpenVPN bridged interfaces sleep(4) - subprocess_cmd(cmd) + # XXX: This is ignoring any issue, should be cmd but kept as it + # XXX: during the migration to not cause any regression + run(command) exit(0) |