From 77ada4131997baa00604815e7440ca35567c731d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Fri, 4 Sep 2026 14:55:21 -0300 Subject: [PATCH] refactor(genesis): keep s390x Perl policy neutral --- xCAT-server/lib/xcat/plugins/mknb.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/mknb.pm b/xCAT-server/lib/xcat/plugins/mknb.pm index 41cce0136..88c489279 100644 --- a/xCAT-server/lib/xcat/plugins/mknb.pm +++ b/xCAT-server/lib/xcat/plugins/mknb.pm @@ -305,9 +305,13 @@ sub _remove_openembedded_genesis { my $config_directory = "$tftpdir/pxelinux.cfg/s390x"; if (opendir(my $config_stream, $config_directory)) { foreach my $name (readdir $config_stream) { - next if $name eq '.' || $name eq '..'; + if ($name =~ m{\A[.][.]?\z}xms) { + next; + } my $path = "$config_directory/$name"; - push @artifacts, $path if _is_generated_s390x_config($path); + if (_is_generated_s390x_config($path)) { + push @artifacts, $path; + } } closedir $config_stream; } @@ -741,7 +745,8 @@ sub process_request { } elsif (exists $GRUB2_DISCOVERY_ARCHES{$arch}) { mkpath("$tftpdir/boot/grub2"); chmod(0755, "$tftpdir/boot/grub2"); - } elsif ($arch eq 's390x') { + } + if ($arch eq 's390x') { mkpath "$tftpdir/pxelinux.cfg/s390x"; chmod 0755, "$tftpdir/pxelinux.cfg"; chmod 0755, "$tftpdir/pxelinux.cfg/s390x"; @@ -761,7 +766,9 @@ sub process_request { "$tftpdir/pxelinux.cfg/s390x/$net", "$tftpdir/pxelinux.cfg/s390x/$net.dpm", ) { - unlink $path if _is_generated_s390x_config($path); + if (_is_generated_s390x_config($path)) { + unlink $path; + } } } next;