mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 09:35:54 +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):
|
if not re.match(r"^\s*#\s*conf\s*:", first_line):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
ret = Attrs()
|
ret = self.Attrs()
|
||||||
|
|
||||||
ret.conf = first_line
|
ret.conf = first_line
|
||||||
|
|
||||||
|
|
@ -98,7 +98,7 @@ class Cmd(Base): # export
|
||||||
src: str,
|
src: str,
|
||||||
dst: str,
|
dst: str,
|
||||||
default_attrs: Attrs | None,
|
default_attrs: Attrs | None,
|
||||||
replace: dict[str, str] = [],
|
replace: dict[str, str] = {},
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
||||||
owner = "root"
|
owner = "root"
|
||||||
|
|
@ -224,7 +224,7 @@ class Cmd(Base): # export
|
||||||
if default_attrs is None:
|
if default_attrs is None:
|
||||||
default_attrs = attrs
|
default_attrs = attrs
|
||||||
secret = target + '.jw-secret'
|
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' ]:
|
for ext in [ '.jw-secret-file', '.jw-tmpl' ]:
|
||||||
src = target + ext
|
src = target + ext
|
||||||
if os.path.exists(src):
|
if os.path.exists(src):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue