Skip to content

Commit 7ebef56

Browse files
Copilotgsanchietti
andcommitted
Reuse existing EUci instance in inventory loops
Co-authored-by: gsanchietti <804596+gsanchietti@users.noreply.github.com>
1 parent 96e95d9 commit 7ebef56

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
5.23 KB
Binary file not shown.

packages/ns-phonehome/files/phonehome

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ features = {}
8484
for func in dir(inventory):
8585
if func.startswith("fact_"):
8686
method = getattr(inventory, func)
87-
features[func.removeprefix('fact_')] = method(EUci())
87+
features[func.removeprefix('fact_')] = method(u)
8888

8989
data = {
9090
"$schema": "https://schema.nethserver.org/facts/2022-12.json",
@@ -118,7 +118,7 @@ info = {}
118118
for func in dir(inventory):
119119
if func.startswith("info_"):
120120
method = getattr(inventory, func)
121-
info[func.removeprefix('info_')] = method(EUci())
121+
info[func.removeprefix('info_')] = method(u)
122122
data['facts'].update(info)
123123

124124
print(json.dumps(data))

0 commit comments

Comments
 (0)