diff options
author | Daniil Baturin <daniil@baturin.org> | 2019-01-26 23:10:00 +0100 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2019-01-26 23:10:00 +0100 |
commit | 97186852f529935309c009e38403cead2bf0ce75 (patch) | |
tree | c5a15278e8b7c70b41223538ece8e326146179e2 /src/helpers/commands-pipe.py | |
parent | 962f880554e70afc94f8902bb3742a8c0ef44fca (diff) | |
parent | 6d172d767360a675462da6a0bac100a24c544892 (diff) | |
download | vyos-1x-97186852f529935309c009e38403cead2bf0ce75.tar.gz vyos-1x-97186852f529935309c009e38403cead2bf0ce75.zip |
Merge branch 'current' into crux
Diffstat (limited to 'src/helpers/commands-pipe.py')
-rwxr-xr-x | src/helpers/commands-pipe.py | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/helpers/commands-pipe.py b/src/helpers/commands-pipe.py deleted file mode 100755 index ab68ccade..000000000 --- a/src/helpers/commands-pipe.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/python3 - -import sys -import re - -from signal import signal, SIGPIPE, SIG_DFL -from vyos.configtree import ConfigTree - -signal(SIGPIPE,SIG_DFL) - -config_string = sys.stdin.read().strip() -config_string = config_string.replace("\\", "\\\\") - -if not config_string: - sys.exit(0) - -# When used in conf mode pipe, the config given to the script is likely incomplete -# and breaks the "all top level nodes are neither tag nor leaf" -# invariant, so we wrap it into a fake node. -# Since nodes don't normally start with an underscore, -# __root__ is hygienic enough. -config_string = "__root__ {{ {0} \n }}".format(config_string) - -config_re = re.compile(r'(set|comment)\s+__root__\s+(.*)') - -config = ConfigTree(config_string) -commands = config.to_commands() -commands = config_re.sub("\\1 \\2", commands) - -print(commands) |