Our checks for .pve-ignore.* files happen at write time so
we mostly don't have to think about them within the
functions dealing with them. /etc/hosts is one of the files
we need nowhere except when updating it, and there are some
tools managing it and producing files too large for our
default file_get_contents() size limit, so here we want to
skip early to avoid an error at read time.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
sub update_etc_hosts {
my ($self, $hostip, $oldname, $newname, $searchdomains) = @_;
+ my $hosts_fn = '/etc/hosts';
+ return if $self->ct_is_file_ignored($hosts_fn);
+
my $namepart = ($newname =~ s/\..*$//r);
my $all_names = '';
# Prepare section:
my $section = '';
- my $hosts_fn = '/etc/hosts';
my $lo4 = "127.0.0.1 localhost.localnet localhost\n";
my $lo6 = "::1 localhost.localnet localhost\n";