Skip to content

Commit

Permalink
Loop over interfaces and parameterize the interface name
Browse files Browse the repository at this point in the history
Signed-off-by: Mohammed Boukhalfa <mohammed.boukhalfa@est.tech>
  • Loading branch information
mboukhalfa committed Sep 20, 2024
1 parent 791418e commit 2ede099
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions fake-ipa/fake_ipa/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ def inspect(system, inspection_callback_url, verify, cert, logger):
"boot_interface": system.get("nics")[0]["mac"],
"inventory": {
"interfaces": [
{
"lldp": None,
"product": "0x0001",
"vendor": "0x1af4",
"name": "eth1",
"has_carrier": True,
"ipv4_address": system.get("nics")[0]["ip"] or None,
"client_id": None,
"mac_address": system.get("nics")[0]["mac"],
}
{
"lldp": None,
"product": "0x0001",
"vendor": "0x1af4",
"name": nic.get("name", f"enp1s{i}"),
"has_carrier": True,
"ipv4_address": nic.get("ip"),
"client_id": None,
"mac_address": nic["mac"],
}
for i, nic in enumerate(system.get("nics"))
],
"cpu": {
"count": 2,
Expand Down

0 comments on commit 2ede099

Please sign in to comment.