mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-10-21 15:18:19 +00:00
refactor(xcat): reuse whitespace trimming in blade and credential paths
This commit is contained in:
@@ -3,6 +3,8 @@ package xCAT::BladeUtils;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use xCAT::StringUtils qw(trim);
|
||||
|
||||
sub blade_nodes_from_mp {
|
||||
my @entries = @_;
|
||||
my %hwtype;
|
||||
@@ -12,7 +14,7 @@ sub blade_nodes_from_mp {
|
||||
next unless ref $entry eq 'HASH' and defined $entry->{node};
|
||||
$hwtype{ $entry->{node} } =
|
||||
defined $entry->{nodetype} ? lc( $entry->{nodetype} ) : q{};
|
||||
$hwtype{ $entry->{node} } =~ s/^\s+|\s+$//gx;
|
||||
$hwtype{ $entry->{node} } = trim($hwtype{ $entry->{node} });
|
||||
$ownmpa{ $entry->{node} } = $entry->{mpa}
|
||||
if defined $entry->{mpa};
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ use xCAT::Utils;
|
||||
use xCAT::NetworkUtils;
|
||||
use xCAT::PasswordUtils;
|
||||
use xCAT::TableUtils;
|
||||
use xCAT::StringUtils qw(trim);
|
||||
|
||||
use xCAT::MsgUtils;
|
||||
use Getopt::Long;
|
||||
@@ -410,7 +411,7 @@ sub _delegated_signer_allowed {
|
||||
sub _endpoint_identities {
|
||||
my $endpoint = shift;
|
||||
return unless defined($endpoint);
|
||||
$endpoint =~ s/^\s+|\s+$//g;
|
||||
$endpoint = trim($endpoint);
|
||||
return unless length($endpoint);
|
||||
|
||||
my %identities;
|
||||
|
||||
Reference in New Issue
Block a user