fix: a machine with no ifupdown configuration is not an error
The release validator caught it: in a container there is no /etc/network/interfaces at all, and a missing file was being treated as a read failure, so --check printed nothing and said nothing was wrong rather than saying there was nothing to do. A machine with no ifupdown configuration is the ordinary case for a fresh install, and the answer is simply that this command has no work. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
b8688d00a7
commit
fe08363534
@@ -208,6 +208,11 @@ def carrying(name, device):
|
|||||||
|
|
||||||
def find_stanza():
|
def find_stanza():
|
||||||
"""The one wireless stanza ifupdown holds, or None, plus the file."""
|
"""The one wireless stanza ifupdown holds, or None, plus the file."""
|
||||||
|
if not os.path.exists(INTERFACES):
|
||||||
|
# A machine with no ifupdown configuration at all. Nothing is
|
||||||
|
# wrong with that and nothing here has anything to do.
|
||||||
|
return None, ""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(INTERFACES, "r", encoding="utf-8") as handle:
|
with open(INTERFACES, "r", encoding="utf-8") as handle:
|
||||||
text = handle.read()
|
text = handle.read()
|
||||||
|
|||||||
@@ -166,7 +166,15 @@ check("it refuses to start when it could not undo itself",
|
|||||||
"shutil.which" in wifi
|
"shutil.which" in wifi
|
||||||
and "leaving the network exactly as it is" in wifi)
|
and "leaving the network exactly as it is" in wifi)
|
||||||
|
|
||||||
print("9. the upgrade does not do any of this on its own")
|
print("9. a machine with no ifupdown configuration at all")
|
||||||
|
# A container, and any machine installed without ifupdown. Found by the
|
||||||
|
# release validator: --check said nothing at all, because a missing file
|
||||||
|
# was being treated as a read error.
|
||||||
|
check("a missing interfaces file is not an error, it is just nothing to do",
|
||||||
|
"not os.path.exists(INTERFACES)" in wifi
|
||||||
|
and 'return None, ""' in wifi)
|
||||||
|
|
||||||
|
print("10. the upgrade does not do any of this on its own")
|
||||||
# Moving a machine's only link during an unattended upgrade is fine until
|
# Moving a machine's only link during an unattended upgrade is fine until
|
||||||
# the once it is not, and the machine it would strand is a laptop in a
|
# the once it is not, and the machine it would strand is a laptop in a
|
||||||
# locked room.
|
# locked room.
|
||||||
|
|||||||
Reference in New Issue
Block a user