Skip to content

Commit

Permalink
Merge pull request #4268 from natali-rs1985/T6956
Browse files Browse the repository at this point in the history
op_mode: T6956: Fix for "generate tech-support archive" if /config contains directories
  • Loading branch information
dmbaturin authored Dec 30, 2024
2 parents c387592 + ec62359 commit 7447a23
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 7447a23

Please sign in to comment.