Browse Source

Update generate_yamls.sh to match current Fuel master

Output of fuel cli commands has been changed so we need to adjust
generate_yamls.sh script to make it work properly.

Change-Id: I0900838f62b1bc0bb77bef504ea3ee3557c6d05c
Aleksandr Didenko 2 years ago
parent
commit
a332949d41
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      utils/generate_yamls.sh

+ 6
- 6
utils/generate_yamls.sh View File

@@ -21,12 +21,12 @@ function create_fake_nodes {
21 21
 }
22 22
 
23 23
 function clean_fake_nodes {
24
-  fuel nodes | grep -q 'discover | fnode-' &&
25
-    fuel nodes | awk '/discover \| fnode-/{ print $1 }' | xargs fuel node --delete-from-db --force --node
24
+  fuel2 node list | grep 'discover' | grep -q 'fnode-' &&
25
+    fuel2 node list | awk '/fnode-.* discover /{ print $2 }'
26 26
 }
27 27
 
28 28
 function admin_net_tpl {
29
-  fuel network-group list | awk '/^1 /{print $9}' | sed -e 's/\.[[:digit:]]\+$//'
29
+  ruby -rjson -e 'print JSON.parse(ARGV[0]).find{|i| i["id"] == 1}["cidr"]' "`fuel network-group list --json`"
30 30
 }
31 31
 
32 32
 function id_of_role {
@@ -124,7 +124,7 @@ function enable_public_ssl {
124 124
 }
125 125
 
126 126
 function enable_vms_conf {
127
-  virt_node_ids=`fuel nodes --env $1 2>/dev/null | grep virt | awk '{print $1}'`
127
+  virt_node_ids=`fuel2 node list --env $1 2>/dev/null | grep virt | awk '{print $2}'`
128 128
   for id in $virt_node_ids ; do
129 129
     fuel2 node create-vms-conf $id --conf '{"id":3,"ram":2,"cpu":2}'
130 130
   done
@@ -133,9 +133,9 @@ function enable_vms_conf {
133 133
 function list_free_nodes {
134 134
   # list unused nodes from the list of fake nodes
135 135
   if [ -n "$1" ] ; then
136
-    fuel nodes 2>/dev/null | grep discover | grep None | grep 'fnode-' | grep $1 | awk '{print $1}'
136
+    fuel2 node list 2>/dev/null | grep discover | grep None | grep 'fnode-' | grep $1 | awk '{print $2}'
137 137
   else
138
-    fuel nodes 2>/dev/null | grep discover | grep None | grep 'fnode-' | awk '{print $1}'
138
+    fuel2 node list 2>/dev/null | grep discover | grep None | grep 'fnode-' | awk '{print $2}'
139 139
   fi
140 140
 }
141 141
 

Loading…
Cancel
Save