mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 17:45:55 +02:00
cmds.secrets.Cmd: Fix errors on Kali 2026.1
Fix errors dug up by testing on Kali Linux 2026.1: - Nested class Cmds.Attrs is constructed without scope - "replace" falls back to empty list, not empty dictionary Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
2aa2493dca
commit
699980c32e
1 changed files with 3 additions and 3 deletions
|
|
@ -49,7 +49,7 @@ class Cmd(Base): # export
|
|||
if not re.match(r"^\s*#\s*conf\s*:", first_line):
|
||||
return None
|
||||
|
||||
ret = Attrs()
|
||||
ret = self.Attrs()
|
||||
|
||||
ret.conf = first_line
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ class Cmd(Base): # export
|
|||
src: str,
|
||||
dst: str,
|
||||
default_attrs: Attrs | None,
|
||||
replace: dict[str, str] = [],
|
||||
replace: dict[str, str] = {},
|
||||
) -> None:
|
||||
|
||||
owner = "root"
|
||||
|
|
@ -224,7 +224,7 @@ class Cmd(Base): # export
|
|||
if default_attrs is None:
|
||||
default_attrs = attrs
|
||||
secret = target + '.jw-secret'
|
||||
replace = [] if not os.path.exists(secret) else self.__read_key_value_file(secret)
|
||||
replace = {} if not os.path.exists(secret) else self.__read_key_value_file(secret)
|
||||
for ext in [ '.jw-secret-file', '.jw-tmpl' ]:
|
||||
src = target + ext
|
||||
if os.path.exists(src):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue