Skip to content

Commit

Permalink
Refactore: multiple sources to single source
Browse files Browse the repository at this point in the history
  • Loading branch information
Nariman committed Sep 20, 2024
1 parent 80512e0 commit d419a1c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dissect/target/helpers/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def DynamicDescriptor(types): # noqa
)

COMMON_INTERFACE_ELEMENTS = [
("stringlist", "sources"),
("string", "source"),
("string", "name"),
("string", "type"),
("boolean", "enabled"),
Expand Down
4 changes: 2 additions & 2 deletions dissect/target/plugins/os/windows/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ def _interfaces(self) -> Iterator[WindowsInterfaceRecord]:
if type_device := _try_value(subkey, "*IfType"):
device_info["type"] = IfTypes(int(type_device)).name

# extract the source paths of the information
device_info["sources"] = [f"HKLM\\SYSTEM\\{key.path}" for key in [subkey, interface_key, name_key]]
# extract the source path of the information
device_info["source"] = f"HKLM\\SYSTEM\\{subkey.path}"

# Yield a record for each non-empty configuration
for conf in config:
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/general/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def network_record(request: pytest.FixtureRequest) -> InterfaceRecord:
ip=["10.42.42.10"],
gateway=["10.42.42.1"],
dns=["8.8.8.8", "1.1.1.1"],
sources=["some_file"],
source=["some_file"],
)


Expand Down

0 comments on commit d419a1c

Please sign in to comment.