kexec-installer: check ip command exit codes
This commit is contained in:
parent
efb8452b0f
commit
ddaae7671a
1 changed files with 7 additions and 3 deletions
|
@ -37,6 +37,7 @@ def main() -> None:
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
["ip", "--json", "addr"],
|
["ip", "--json", "addr"],
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
|
check=True
|
||||||
).stdout
|
).stdout
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -53,7 +54,8 @@ def main() -> None:
|
||||||
"dev",
|
"dev",
|
||||||
current_interface["ifname"],
|
current_interface["ifname"],
|
||||||
f'{addr["local"]}/{addr["prefixlen"]}',
|
f'{addr["local"]}/{addr["prefixlen"]}',
|
||||||
]
|
],
|
||||||
|
check=True
|
||||||
)
|
)
|
||||||
for route in routes:
|
for route in routes:
|
||||||
if route["dev"] == interface["ifname"]:
|
if route["dev"] == interface["ifname"]:
|
||||||
|
@ -68,7 +70,8 @@ def main() -> None:
|
||||||
route["gateway"],
|
route["gateway"],
|
||||||
"dev",
|
"dev",
|
||||||
current_interface["ifname"],
|
current_interface["ifname"],
|
||||||
]
|
],
|
||||||
|
check=True
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
|
@ -79,7 +82,8 @@ def main() -> None:
|
||||||
route["dst"],
|
route["dst"],
|
||||||
"dev",
|
"dev",
|
||||||
current_interface["ifname"],
|
current_interface["ifname"],
|
||||||
]
|
],
|
||||||
|
check=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue