[virtual] Add missing ODL dhcp_int 83/51783/2
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Tue, 6 Feb 2018 16:55:04 +0000 (17:55 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Tue, 6 Feb 2018 22:30:06 +0000 (23:30 +0100)
- add missing network definitions for ODL node's 1st interface;
- add missing comments for `notify` global functions;
- fix or silence shellcheck issues;

JIRA: FUEL-322

Change-Id: Ie3341d29ab12ddf432db603ad865259afb54714e
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
ci/deploy.sh
mcp/reclass/classes/cluster/virtual-mcp-pike-odl-noha/opendaylight/control_pdf.yml.j2
mcp/scripts/globals.sh
mcp/scripts/lib.sh
mcp/scripts/salt.sh

index fb22cc4..18de570 100755 (executable)
@@ -288,7 +288,7 @@ do_templates "${REPO_ROOT_PATH}" "${STORAGE_DIR}" "${TARGET_LAB}" \
 
 # Get required infra deployment data based on PDF/IDF (after template parsing)
 set +x
-eval "$(parse_yaml "${LOCAL_PDF_RECLASS}")"
+eval "$(parse_yaml "${STORAGE_DIR}/pod_config.yml")"
 [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
 
 # Serialize vnode data as '<name0>,<ram0>,<vcpu0>|<name1>,<ram1>,<vcpu1>[...]'
@@ -346,7 +346,7 @@ else
     check_connection
 fi
 if [ ${USE_EXISTING_INFRA} -lt 2 ]; then
-    wait_for 5 "./salt.sh ${LOCAL_PDF_RECLASS} ${virtual_nodes[*]}"
+    wait_for 5 "./salt.sh ${STORAGE_DIR}/pod_config.yml ${virtual_nodes[*]}"
 fi
 
 # Openstack cluster setup
index 74f9288..fbb7de8 100644 (file)
@@ -11,6 +11,11 @@ parameters:
   linux:
     network:
       interface:
+        dhcp_int:
+          enabled: true
+          name: {{ nm.ctl01.nic_admin }}
+          proto: dhcp
+          type: eth
         single_int:
           enabled: true
           name: {{ nm.ctl01.nic_mgmt }}
index 8966a0a..54f015c 100644 (file)
@@ -25,22 +25,27 @@ export SSH_SALT="${SALT_MASTER_USER}@${SALT_MASTER}"
 ##############################################################################
 # BEGIN of colored notification wrappers
 #
+
+# same as `notify_i` + trailing '\n';
 function notify() {
     local msg=${1}; shift
     notify_i "${msg}\n" "$@"
 }
 
+# Inline (no newline added) colored output notification wrapper
 function notify_i() {
     tput setaf "${2:-1}" || true
     echo -en "${1:-"[WARN] Unsupported opt arg: $3\\n"}"
     tput sgr0
 }
 
+# same as `notify` + extra '\n' before and after;
 function notify_n() {
     local msg=${1}; shift
     notify_i "\n${msg}\n\n" "$@"
 }
 
+# same as `notify` + stderr output + exit;
 function notify_e() {
     local msg=${1}; shift
     notify_i "\n${msg}\n\n" "$@" 1>&2
index 02c23f3..5b00c73 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/bash -e
-# shellcheck disable=SC2155,SC1001
+# shellcheck disable=SC2155,SC1001,SC2015
 ##############################################################################
 # Copyright (c) 2017 Mirantis Inc., Enea AB and others.
 # All rights reserved. This program and the accompanying materials
@@ -452,7 +452,7 @@ function wait_for {
         # shellcheck disable=SC2015
         eval "${cmdstr}" && echo "[wait_for] OK: ${cmdstr}" && return 0 || true
       else
-        !(eval "${cmdstr}" || echo __fuel_wf_failure__) |& tee /dev/stderr | \
+        ! (eval "${cmdstr}" || echo __fuel_wf_failure__) |& tee /dev/stderr | \
           grep -Eq '(Not connected|No response|__fuel_wf_failure__)' && \
           echo "[wait_for] OK: ${cmdstr}" && return 0 || true
       fi
@@ -498,7 +498,6 @@ function do_templates() {
   BASE_CONFIG_IDF="${lab_config_uri}/labs/${target_lab}/idf-${target_pod}.yaml"
   LOCAL_PDF="${image_dir}/$(basename "${BASE_CONFIG_PDF}")"
   LOCAL_IDF="${image_dir}/$(basename "${BASE_CONFIG_IDF}")"
-  LOCAL_PDF_RECLASS="${image_dir}/pod_config.yml"
 
   # Two-stage expansion, first stage handles pod_config and scenarios only
   if [ -n "${scenario_dir}" ]; then
@@ -511,7 +510,7 @@ function do_templates() {
     elif ! curl -o "${LOCAL_IDF}" "${BASE_CONFIG_IDF}"; then
       notify_e "[ERROR] Could not retrieve IDF (Installer Descriptor File)!"
     elif ! "${PHAROS_GEN_CFG}" -y "${LOCAL_PDF}" \
-        -j "${PHAROS_INSTALLER_ADAPTER}" > "${LOCAL_PDF_RECLASS}"; then
+        -j "${PHAROS_INSTALLER_ADAPTER}" > "${image_dir}/pod_config.yml"; then
       notify_e "[ERROR] Could not convert PDF+IDF to reclass model input!"
     fi
     template_dirs="${scenario_dir}"
index 310b78a..15168c0 100755 (executable)
@@ -22,6 +22,7 @@ OPNFV_VCP_IMG="mcp/scripts/base_image_opnfv_fuel_vcp.img"
 OPNFV_VCP_DIR="/srv/salt/env/prd/salt/files/control/images"
 LOCAL_GIT_DIR="${F_GIT_ROOT%${F_GIT_SUBD}}"
 LOCAL_PDF_RECLASS=$1; shift
+# shellcheck disable=SC2116,SC2086
 LOCAL_VIRT_NODES=$(echo ${*//cfg01/}) # unquoted to filter space
 NODE_MASK="${LOCAL_VIRT_NODES// /|}"