summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canonical.com>2017-08-17 20:07:09 -0500
committerNarinder Gupta <narinder.gupta@canonical.com>2017-08-17 20:09:58 -0500
commitf396b9912eb0f0c39aa72021d8ec4b8caf340bf2 (patch)
treeb443ac5d03d9b4193ce8e0b09c64371c982e4317
parent46d324c59c8791d0e54cafc00b3e2ccaf9adf269 (diff)
modified to do error checking
Change-Id: I1292f0e6a9ba63965fe13229f11ebfdc914bd7b1 Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
-rwxr-xr-xci/03-maasdeploy.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/ci/03-maasdeploy.sh b/ci/03-maasdeploy.sh
index 788454c9..db60bbfc 100755
--- a/ci/03-maasdeploy.sh
+++ b/ci/03-maasdeploy.sh
@@ -612,6 +612,7 @@ if [ -e ./labconfig.json ]; then
'data') IF_MODE='AUTO' ;;
'public') IF_MODE='AUTO' ;;
'storage') IF_MODE='AUTO' ;;
+ 'osapi') IF_MODE='AUTO' ;;
'floating') IF_MODE='link_up' ;;
*) SUBNET_CIDR='null'; IF_MODE='null'; echo_info " >>> Unknown SPACE" ;;
esac
@@ -630,8 +631,12 @@ if [ -e ./labconfig.json ]; then
if ([ $IF_VLAN ] && [ "$IF_VLAN" != "null" ]); then
echo_info " >>> Configuring VLAN $IF_VLAN"
VLANID=$(maas $PROFILE subnets read | jq ".[].vlan | select(.vid==$IF_VLAN)".id)
- FABRICID=$(maas $PROFILE subnets read | jq ".[].vlan | select(.vid==$IF_VLAN)".fabric_id)
- INTERFACE=$(maas $PROFILE interfaces read $NODE_SYS_ID | jq ".[] | select(.vlan.fabric_id==$FABRICID)".id)
+ if ([ $VLANID ] && [ "$VLANID" != "null" ]); then
+ FABRICID=$(maas $PROFILE subnets read | jq ".[].vlan | select(.vid==$IF_VLAN)".fabric_id)
+ if ([ $FABRICID ] && [ "$FABRICID" != "null" ]); then
+ INTERFACE=$(maas $PROFILE interfaces read $NODE_SYS_ID | jq ".[] | select(.vlan.fabric_id==$FABRICID)".id)
+ fi
+ fi
if [[ -z $INTERFACE ]]; then
# parent interface is not set because it does not have a SUBNET_CIDR
PARENT_VLANID=$(maas $PROFILE fabrics read | jq ".[].vlans[] | select(.fabric_id==$FABRICID and .name==\"untagged\")".id)