diff --git a/perl-xCAT/xCAT/PPCdb.pm b/perl-xCAT/xCAT/PPCdb.pm index af6eebead..51967544d 100644 --- a/perl-xCAT/xCAT/PPCdb.pm +++ b/perl-xCAT/xCAT/PPCdb.pm @@ -217,14 +217,16 @@ sub add_ppc { ############################### # Update hosts table ############################### - if ($otherinterfaces) { - $db{hosts}->setNodeAttribs($name, - { otherinterfaces => $ips }); - } else { - $db{hosts}->setNodeAttribs($name, - { ip => $ips }); + if ($ips) { + if ($otherinterfaces) { + $db{hosts}->setNodeAttribs($name, + { otherinterfaces => $ips }); + } else { + $db{hosts}->setNodeAttribs($name, + { ip => $ips }); + } + $db{hosts}{commit} = 1; } - $db{hosts}{commit} = 1; ############################### # Update mac table