summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authornarindergupta <narinder.gupta@canonical.com>2017-04-28 11:29:24 +0200
committernarindergupta <narinder.gupta@canonical.com>2017-04-28 11:30:02 +0200
commitbdd8b40ac6b40cb126b4b13f1ae74f7dfeffcd68 (patch)
treef54ee4221543275dfae4db1d2952cdf837d147b3 /ci
parent3b01c25368e43aac8fd424585a51ffd65d539812 (diff)
modified to correct the error ID failed in case of error.
Change-Id: I669aeccd0ceef758fa9eee87d46426bd6a78230b Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/03-maasdeploy.sh6
1 files changed, 4 insertions, 2 deletions
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