NAS-138810 / 26.04 / Update truenas_verify to not report nfs.conf.d (#952)

* Exclude /etc/nfs.conf.d.   This directory is removed by nfs.conf.mako.

* Add exception handling for os.unlink when processing objects that
are aleady missing.
This commit is contained in:
Mark Grimes
2025-12-05 07:14:00 -08:00
committed by GitHub
parent a9b5cf4661
commit 98f881d070

View File

@@ -26,6 +26,7 @@ ETC_FILES_TO_REMOVE = [
'etc/krb5.conf',
'etc/mailname',
'etc/motd',
'etc/nfs.conf.d',
'etc/nscd.conf',
'etc/resolv.conf',
'etc/avahi/avahi-daemon.conf',
@@ -136,7 +137,12 @@ def generate_mtree(target_root_dir, version):
# we replace when we etc.generate. If they're not required for
# first boot, then remove from update file.
for file in ETC_FILES_TO_REMOVE:
os.unlink(os.path.join(target_root_dir, file))
try:
os.unlink(os.path.join(target_root_dir, file))
except FileNotFoundError:
# We want to avoid failing the build if the object is
# aleady removed. Possibly time to update the list.
pass
# Some files and/or directories get their permission mode changed
# after install. We preemptively make those mode changes here