From bdd8b40ac6b40cb126b4b13f1ae74f7dfeffcd68 Mon Sep 17 00:00:00 2001 From: narindergupta Date: Fri, 28 Apr 2017 11:29:24 +0200 Subject: modified to correct the error ID failed in case of error. Change-Id: I669aeccd0ceef758fa9eee87d46426bd6a78230b Signed-off-by: Narinder Gupta --- ci/03-maasdeploy.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ci') diff --git a/ci/03-maasdeploy.sh b/ci/03-maasdeploy.sh index 505e167f..85239506 100755 --- a/ci/03-maasdeploy.sh +++ b/ci/03-maasdeploy.sh @@ -654,8 +654,10 @@ if [ -e ./labconfig.json ]; then IF_MACLOWER=$( cat labconfig.json | jq ".lab.racks[0].nodes[$NODE_ID].nics[] | select(.ifname==\"$IF_NEWNAME\")".mac[0]) IF_MAC=(${IF_MACLOWER,,}) IF_ID=$( maas ubuntu interfaces read $NODE_SYS_ID | jq ".[] | select(.mac_address==$IF_MAC)".id) - maas $PROFILE interface update $NODE_SYS_ID $IF_ID name=$IF_NEWNAME - IF_NAME=$IF_NEWNAME + if ([ $IF_ID ] && [ "$IF_ID" != "null" ]); then + maas $PROFILE interface update $NODE_SYS_ID $IF_ID name=$IF_NEWNAME + IF_NAME=$IF_NEWNAME + fi fi # In case of a VLAN interface -- cgit 1.2.3-korg