diff options
author | Nataliia Solomko <natalirs1985@gmail.com> | 2024-12-29 20:49:35 +0200 |
---|---|---|
committer | Nataliia Solomko <natalirs1985@gmail.com> | 2024-12-29 20:49:35 +0200 |
commit | ec62359a0f7740022e8d1d3203882c8f6cd5f9f6 (patch) | |
tree | 3cc689da71625d609d78e4f9ee60d16175c7e7b9 /src | |
parent | c38759211537050c504b95fa87e905d08a0288d2 (diff) | |
download | vyos-1x-ec62359a0f7740022e8d1d3203882c8f6cd5f9f6.tar.gz vyos-1x-ec62359a0f7740022e8d1d3203882c8f6cd5f9f6.zip |
op_mode: T6956: Fix for "generate tech-support archive" if /config contains directories
Diffstat (limited to 'src')
-rw-r--r-- | src/op_mode/tech_support.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/op_mode/tech_support.py b/src/op_mode/tech_support.py index f60bb87ff..24ac0af1b 100644 --- a/src/op_mode/tech_support.py +++ b/src/op_mode/tech_support.py @@ -97,21 +97,22 @@ def _get_boot_config(): return strip_config_source(config) def _get_config_scripts(): - from os import listdir + from os import walk from os.path import join from vyos.utils.file import read_file scripts = [] dir = '/config/scripts' - for f in listdir(dir): - script = {} - path = join(dir, f) - data = read_file(path) - script["path"] = path - script["data"] = data - - scripts.append(script) + for dirpath, _, filenames in walk(dir): + for filename in filenames: + script = {} + path = join(dirpath, filename) + data = read_file(path) + script["path"] = path + script["data"] = data + + scripts.append(script) return scripts |