From 4d5734558bd78f71e576e5946256cbc758863bd7 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 16 Jun 2016 03:47:51 -0400 Subject: [PATCH] issue1308 lsdef and Rest API issues with regex on nicks --- perl-xCAT/xCAT/DBobjUtils.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index f71625898..780f5fbcc 100755 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -2458,6 +2458,10 @@ sub expandnicsattr() # Value: eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1 my $nicval=$2; + #In the lsdef, remove the ^| and |$ before displaying + $nicval=~s/(^\||\|$)//g; + + # $nicarr[0]: eth0!1.1.1.1|2.1.1.1 # $nicarr[1]: eth1!3.1.1.1|4.1.1.1 my @nicarr = split(/,/, $nicval);