diff options
author | zsdc <taras@vyos.io> | 2021-12-29 17:57:38 +0200 |
---|---|---|
committer | zsdc <taras@vyos.io> | 2022-02-07 09:52:37 +0200 |
commit | 373132a899cd53eaebedd23bd44702d245ce8165 (patch) | |
tree | 3e1b6386480d118df486f7bb8d1bdf104c4ed623 /python/vyos | |
parent | 1af618103f288d83c51dee3d20e49f06e02b1ac7 (diff) | |
download | vyos-1x-373132a899cd53eaebedd23bd44702d245ce8165.tar.gz vyos-1x-373132a899cd53eaebedd23bd44702d245ce8165.zip |
FRR: T4020: Updated CLI options processing for FRR daemons
- Reverted changes from `python/vyos/util.py`. This may lead to
unnecessary FRR restart during each boot, depending on a default file
content and template, but makes this changeset cleaner.
- Fixed typos in node names (extra `>` characters).
- Added SNMP module for `isisd` and `ldpd`, since they have it compiled
now.
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/util.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/python/vyos/util.py b/python/vyos/util.py index ce5dc51f5..d8e83ab8d 100644 --- a/python/vyos/util.py +++ b/python/vyos/util.py @@ -182,20 +182,16 @@ def call(command, flag='', shell=None, input=None, timeout=None, env=None, return code -def read_file(fname, defaultonfailure=None, strip_end=True): +def read_file(fname, defaultonfailure=None): """ - read the content of a file, optionally stripping any end characters (space, newlines) + read the content of a file, stripping any end characters (space, newlines) should defaultonfailure be not None, it is returned on failure to read """ try: """ Read a file to string """ with open(fname, 'r') as f: - data = f.read() - - if strip_end: - return data.strip() - else: - return data + data = f.read().strip() + return data except Exception as e: if defaultonfailure is not None: return defaultonfailure |