Add yq checker
[kuberef.git] / functions.sh
index e64bf91..f0e1213 100755 (executable)
@@ -49,6 +49,14 @@ check_prerequisites() {
         exit 1
     fi
 
+    #-------------------------------------------------------------------------------
+    # Check is yq is installed
+    #-------------------------------------------------------------------------------
+    if ! command -v yq &> /dev/null; then
+        echo "ERROR : yq not found. Please install."
+        exit 1
+    fi
+
     #-------------------------------------------------------------------------------
     # Check is libvirt is installed
     #-------------------------------------------------------------------------------
@@ -167,7 +175,7 @@ if [ ! -d "${PROJECT_ROOT}/container-experience-kits" ]; then
     cp -r ${PROJECT_ROOT}/container-experience-kits/examples/group_vars ${PROJECT_ROOT}/container-experience-kits/
 #TODO Remove this once the reported issue is fixed in the next BMRA Release
     sed -i '/\openshift/a \    extra_args: --ignore-installed PyYAML' \
-         ${PROJECT_ROOT}/container-experience-kits/roles/net-attach-defs-create/tasks/main.yml
+        ${PROJECT_ROOT}/container-experience-kits/roles/net-attach-defs-create/tasks/main.yml
 fi
 cp ${PROJECT_ROOT}/${INSTALLER}/inventory.ini \
     ${PROJECT_ROOT}/container-experience-kits/