Skip to content

Commit

Permalink
op_mode: T6956: Fix for "generate tech-support archive" if /config co…
Browse files Browse the repository at this point in the history
…ntains directories
  • Loading branch information
natali-rs1985 committed Dec 29, 2024
1 parent c387592 commit ec62359
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/op_mode/tech_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ec62359

Please sign in to comment.