Fix a bug for hostname valiation pattern
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15107 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
8efa7cdd67
commit
9c69cb198a
@ -2186,8 +2186,12 @@ sub isValidMAC
|
||||
sub isValidHostname
|
||||
{
|
||||
my ($class, $hostname) = @_;
|
||||
if ($hostname =~ /^[a-z0-9][\-a-z0-9]+[a-z0-9]$/){
|
||||
return 1;
|
||||
if ($hostname =~ /^[a-z0-9]/){
|
||||
if ($hostname =~ /[a-z0-9]$/){
|
||||
if ($hostname =~ /[\-a-z0-9]+/){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user