Merge "Tune up mysql options"
[fuel.git] / mcp / scripts / lib.sh
index d9b5e63..650c63b 100644 (file)
@@ -17,7 +17,7 @@ generate_ssh_key() {
   fi
 
   [ -f "${mcp_ssh_key}" ] || ssh-keygen -f "${mcp_ssh_key}" -N ''
-  install -D -o "${user}" -m 0600 "${mcp_ssh_key}" "${SSH_KEY}"
+  sudo install -D -o "${user}" -m 0600 "${mcp_ssh_key}" "${SSH_KEY}"
 }
 
 get_base_image() {
@@ -65,7 +65,8 @@ create_networks() {
   # create required networks, including constant "mcpcontrol"
   # FIXME(alav): since we renamed "pxe" to "mcpcontrol", we need to make sure
   # we delete the old "pxe" virtual network, or it would cause IP conflicts.
-  for net in "pxe" "mcpcontrol" "${vnode_networks[@]}"; do
+  # FIXME(alav): The same applies for "fuel1" virsh network.
+  for net in "fuel1" "pxe" "mcpcontrol" "${vnode_networks[@]}"; do
     if virsh net-info "${net}" >/dev/null 2>&1; then
       virsh net-destroy "${net}" || true
       virsh net-undefine "${net}"
@@ -141,7 +142,7 @@ start_vms() {
   # start vms
   for node in "${vnodes[@]}"; do
     virsh start "${node}"
-    sleep $[RANDOM%5+1]
+    sleep $((RANDOM%5+1))
   done
 }