2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-22 03:00:26 +00:00

Merge pull request #3432 from bybai/mkhost

enhance makehosts support regex in nicips
This commit is contained in:
zet809
2017-07-12 15:57:31 +08:00
committed by GitHub

View File

@@ -72,7 +72,6 @@ sub addnode
# if this ip was already added then just update the entry
while ($idx <= $#hosts)
{
if ($hosts[$idx] =~ /^${ip}\s/
or $hosts[$idx] =~ /^\d+\.\d+\.\d+\.\d+\s+${node}[\s\.\r]/)
{
@@ -661,7 +660,10 @@ sub donics
if (!$nicip) {
next;
}
#Only support format for nicips is :<nic1>!<ip1>|<ip2>|... or <nic1>!<one regular expression>
if ($nicip =~ /^\|\S*\|$/) {
$nicip = xCAT::Table::transRegexAttrs($node, $nicip);
}
if ($nicip =~ /\|/) {
my @ips = split(/\|/, $nicip);
foreach my $ip (@ips) {