diff --git a/bin/openstack-cluster-installer-build-live-image b/bin/openstack-cluster-installer-build-live-image index 0ff64c55776193459d4c28b28bb4d16f1fd523e4..fb3fc033e7be64391c14c14894b8776d3786acb9 100755 --- a/bin/openstack-cluster-installer-build-live-image +++ b/bin/openstack-cluster-installer-build-live-image @@ -565,8 +565,8 @@ mkdir -p config/includes.chroot/etc/systemd/system/getty@.service.d echo "ExecStart=-/sbin/agetty --autologin root --noclear %I \$TERM" >config/includes.chroot/etc/systemd/system/getty@.service.d/root-autologin.conf # Copy the customization by the user -if [ -e /etc/openstack-cluster-installer/live-image-additions ] ; then - if [ -n ""$(ls /etc/openstack-cluster-installer/live-image-additions) ] ; then +if [ -d /etc/openstack-cluster-installer/live-image-additions ] ; then + if [ -n "$(ls /etc/openstack-cluster-installer/live-image-additions)" ] ; then if [ -r /etc/openstack-cluster-installer/oci-firmware-upgrade-config.json ] ; then mkdir -p config/includes.chroot/etc/oci cp /etc/openstack-cluster-installer/oci-firmware-upgrade-config.json config/includes.chroot/etc/oci/ diff --git a/common/usr/bin/openstack-cluster-installer-agent b/common/usr/bin/openstack-cluster-installer-agent index 33df02c059faf0cb3cface7ebef08637e8db784d..b57c52c5d8d4781739a95849efd0c9facef5fc64 100755 --- a/common/usr/bin/openstack-cluster-installer-agent +++ b/common/usr/bin/openstack-cluster-installer-agent @@ -39,7 +39,7 @@ fi TMPFILE=$(mktemp -t openstack-cluster-installer-agent.XXXXXX) lsblk -b -l -d -J --exclude 2,7,11 >${TMPFILE} TMPFILE2=$(mktemp -t openstack-cluster-installer-agent.XXXXXX) -if [ ""$(cat ${TMPFILE} | wc -l) = "0" ] ; then +if [ "$(cat ${TMPFILE} | wc -l)" = "0" ] ; then # No disk present echo '{ "blockdevices": [ @@ -117,10 +117,10 @@ esac UPGRADE_CONFIG=/etc/oci/oci-firmware-upgrade-config.json if [ -r ${UPGRADE_CONFIG} ] ; then # Spaces in product names are annoying, so we convert them to underscore - PRODUCT_LIST=$(cat ${UPGRADE_CONFIG} | jq -r '. | keys[]' | sed 's/ /_/' | tr '\n' ' ') + PRODUCT_LIST=$(cat ${UPGRADE_CONFIG} | jq -r '. | keys[]' | sed 's/ /_/g' | tr '\n' ' ') for PRODUCT_NAME_TARGET in ${PRODUCT_LIST} ; do # If the current server type matches one of the product names listed in oci-firmware-upgrade-config.json - if [ "${PRODUCT_NAME_TARGET}" = ""$(echo ${PRODUCT_NAME} | sed 's/ /_/') ] ; then + if [ "${PRODUCT_NAME_TARGET}" = "$(echo ${PRODUCT_NAME} | sed 's/ /_/g')" ] ; then # Check if we have an upgrade for the BIOS BIOS_TARGET_VERSION=$(cat ${UPGRADE_CONFIG} | jq -r '.["'"${PRODUCT_NAME}"'"]["BIOS"]["version"]') if [ "${BIOS_TARGET_VERSION}" != "null" ] && dpkg --compare-versions "${BIOS_VERSION}" lt "${BIOS_TARGET_VERSION}" ; then diff --git a/src/report.php b/src/report.php index 27b6199c3b964bc0336e5c68c5bd95e6039d760d..982fed82ef846145a803b10cc6e781b6cf3a464a 100644 --- a/src/report.php +++ b/src/report.php @@ -155,7 +155,7 @@ if($n == 0){ $safe_if_switch_hostname = $if_switch_hostname; $if_switchport_name = $iface["switchport_name"]; - $reg = '/^[0-9a-zA-Z-]{1,64}$/'; + $reg = '/^[.:0-9a-zA-Z-]{1,64}$/'; if(!preg_match($reg,$if_switchport_name)) die("Switchport name suspicious"); $safe_if_switchport_name = $if_switchport_name; @@ -246,7 +246,7 @@ if($n == 0){ $safe_if_switch_hostname = $if_switch_hostname; $if_switchport_name = $iface["switchport_name"]; - $reg = '/^[.0-9a-zA-Z-]{1,64}$/'; + $reg = '/^[.:0-9a-zA-Z-]{1,64}$/'; if(!preg_match($reg,$if_switchport_name)) die("Switchport name suspicious"); $safe_if_switchport_name = $if_switchport_name;