summaryrefslogtreecommitdiffstats
path: root/ci/03-maasdeploy.sh
diff options
context:
space:
mode:
authorRyota MIBU <r-mibu@cq.jp.nec.com>2017-02-17 04:31:47 +0000
committerNarinder Gupta <narinder.gupta@canonical.com>2017-02-17 05:02:49 +0000
commit8603e2e50510f3d76d8b990203f58c1916c33822 (patch)
tree86cf1abb13cf732bd4090836f06fba26cc961b2a /ci/03-maasdeploy.sh
parent38256368b7d330e2ce1309cc0a64bf57bbeeae41 (diff)
fix searching with jq select
Change-Id: I98842799db56040c935336758db3de1e02825a41 Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
Diffstat (limited to 'ci/03-maasdeploy.sh')
-rwxr-xr-xci/03-maasdeploy.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/ci/03-maasdeploy.sh b/ci/03-maasdeploy.sh
index d082f466..93f81020 100755
--- a/ci/03-maasdeploy.sh
+++ b/ci/03-maasdeploy.sh
@@ -327,7 +327,7 @@ addnodes(){
power_parameters_power_address='qemu+ssh://'$USER'@'$MAAS_IP'/system' \
architecture='amd64/generic' power_parameters_power_id='bootstrap'
- bootstrapid=$(maas $PROFILE machines read | jq -r 'select(.[].hostname == "bootstrap")[0].system_id')
+ bootstrapid=$(maas $PROFILE machines read | jq -r '.[] | select(.hostname == "bootstrap").system_id')
maas $PROFILE tag update-nodes bootstrap add=$bootstrapid
@@ -360,17 +360,17 @@ addnodes(){
tags='control' hostname='node1-control' power_type='virsh' mac_addresses=$node1controlmac \
power_parameters_power_address='qemu+ssh://'$USER'@'$MAAS_IP'/system' \
architecture='amd64/generic' power_parameters_power_id='node1-control'
- controlnodeid=$(maas $PROFILE machines read | jq -r 'select(.[].hostname == "node1-control")[0].system_id')
+ controlnodeid=$(maas $PROFILE machines read | jq -r '.[] | select(.hostname == "node1-control").system_id')
maas $PROFILE machines create autodetect_nodegroup='yes' name='node2-compute' \
tags='compute' hostname='node2-compute' power_type='virsh' mac_addresses=$node2computemac \
power_parameters_power_address='qemu+ssh://'$USER'@'$MAAS_IP'/system' \
architecture='amd64/generic' power_parameters_power_id='node2-compute'
- compute2nodeid=$(maas $PROFILE machines read | jq -r 'select(.[].hostname == "node2-compute")[0].system_id')
+ compute2nodeid=$(maas $PROFILE machines read | jq -r '.[] | select(.hostname == "node2-compute").system_id')
maas $PROFILE machines create autodetect_nodegroup='yes' name='node5-compute' \
tags='compute' hostname='node5-compute' power_type='virsh' mac_addresses=$node5computemac \
power_parameters_power_address='qemu+ssh://'$USER'@'$MAAS_IP'/system' \
architecture='amd64/generic' power_parameters_power_id='node5-compute'
- compute5nodeid=$(maas $PROFILE machines read | jq -r 'select(.[].hostname == "node5-compute")[0].system_id')
+ compute5nodeid=$(maas $PROFILE machines read | jq -r '.[] | select(.hostname == "node5-compute").system_id')
maas $PROFILE tag update-nodes control add=$controlnodeid || true
maas $PROFILE tag update-nodes compute add=$compute2nodeid || true