From 04a542134f14ebadcffb781a85100eb99bc216d8 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Tue, 27 Jan 2015 10:52:08 +0100 Subject: [PATCH] ironic-discoverd-ramdisk element cleanup - Properly rename files - Use new package-installs - Properly check for discoverd_callback_url option (and return backward compatibility) Change-Id: I2247047b9360945408e720329d5b134cfa384ae5 --- .../{discovery-ironic => ironic-discoverd-ramdisk} | 0 elements/ironic-discoverd-ramdisk/element-deps | 1 + ...discovery-ironic => 80-ironic-discoverd-ramdisk} | 13 ++++++++++++- .../51-discovery-ironic-install-util-linux | 6 ------ .../install.d/53-discovery-ironic-install-curl | 6 ------ .../install.d/54-discovery-ironic-install-dmidecode | 6 ------ .../install.d/55-discovery-ironic-install-ipmitool | 6 ------ .../ironic-discoverd-ramdisk/package-installs.yaml | 4 ++++ 8 files changed, 17 insertions(+), 25 deletions(-) rename elements/ironic-discoverd-ramdisk/binary-deps.d/{discovery-ironic => ironic-discoverd-ramdisk} (100%) create mode 100644 elements/ironic-discoverd-ramdisk/element-deps rename elements/ironic-discoverd-ramdisk/init.d/{80-discovery-ironic => 80-ironic-discoverd-ramdisk} (83%) delete mode 100755 elements/ironic-discoverd-ramdisk/install.d/51-discovery-ironic-install-util-linux delete mode 100755 elements/ironic-discoverd-ramdisk/install.d/53-discovery-ironic-install-curl delete mode 100755 elements/ironic-discoverd-ramdisk/install.d/54-discovery-ironic-install-dmidecode delete mode 100755 elements/ironic-discoverd-ramdisk/install.d/55-discovery-ironic-install-ipmitool create mode 100644 elements/ironic-discoverd-ramdisk/package-installs.yaml diff --git a/elements/ironic-discoverd-ramdisk/binary-deps.d/discovery-ironic b/elements/ironic-discoverd-ramdisk/binary-deps.d/ironic-discoverd-ramdisk similarity index 100% rename from elements/ironic-discoverd-ramdisk/binary-deps.d/discovery-ironic rename to elements/ironic-discoverd-ramdisk/binary-deps.d/ironic-discoverd-ramdisk diff --git a/elements/ironic-discoverd-ramdisk/element-deps b/elements/ironic-discoverd-ramdisk/element-deps new file mode 100644 index 000000000..7076aba94 --- /dev/null +++ b/elements/ironic-discoverd-ramdisk/element-deps @@ -0,0 +1 @@ +package-installs diff --git a/elements/ironic-discoverd-ramdisk/init.d/80-discovery-ironic b/elements/ironic-discoverd-ramdisk/init.d/80-ironic-discoverd-ramdisk similarity index 83% rename from elements/ironic-discoverd-ramdisk/init.d/80-discovery-ironic rename to elements/ironic-discoverd-ramdisk/init.d/80-ironic-discoverd-ramdisk index 5e70d3355..4da77ff8d 100644 --- a/elements/ironic-discoverd-ramdisk/init.d/80-discovery-ironic +++ b/elements/ironic-discoverd-ramdisk/init.d/80-ironic-discoverd-ramdisk @@ -1,4 +1,15 @@ -readonly DISCOVERD_URL=$(get_kernel_parameter discoverd_callback_url) +DISCOVERD_URL=$(get_kernel_parameter discoverd_callback_url) +if [ -z "$DISCOVERD_URL" ]; then + # Some old ramdisks are around + DISCOVERD_URL=$(get_kernel_parameter ironic_callback_url) + if [ -z "$DISCOVERD_URL" ]; then + echo "No discoverd_callback_url supplied" + troubleshoot + else + echo "WARNING: deprecated option ironic_callback_url" + echo "WARNING: use discoverd_callback_url instead" + fi +fi function request_curl(){ HTTP_METHOD=$1 diff --git a/elements/ironic-discoverd-ramdisk/install.d/51-discovery-ironic-install-util-linux b/elements/ironic-discoverd-ramdisk/install.d/51-discovery-ironic-install-util-linux deleted file mode 100755 index 236ecd7f0..000000000 --- a/elements/ironic-discoverd-ramdisk/install.d/51-discovery-ironic-install-util-linux +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eu -set -o pipefail - -install-packages util-linux diff --git a/elements/ironic-discoverd-ramdisk/install.d/53-discovery-ironic-install-curl b/elements/ironic-discoverd-ramdisk/install.d/53-discovery-ironic-install-curl deleted file mode 100755 index 0871746ed..000000000 --- a/elements/ironic-discoverd-ramdisk/install.d/53-discovery-ironic-install-curl +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eu -set -o pipefail - -install-packages curl diff --git a/elements/ironic-discoverd-ramdisk/install.d/54-discovery-ironic-install-dmidecode b/elements/ironic-discoverd-ramdisk/install.d/54-discovery-ironic-install-dmidecode deleted file mode 100755 index d9a309e45..000000000 --- a/elements/ironic-discoverd-ramdisk/install.d/54-discovery-ironic-install-dmidecode +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eu -set -o pipefail - -install-packages dmidecode diff --git a/elements/ironic-discoverd-ramdisk/install.d/55-discovery-ironic-install-ipmitool b/elements/ironic-discoverd-ramdisk/install.d/55-discovery-ironic-install-ipmitool deleted file mode 100755 index 90abd0124..000000000 --- a/elements/ironic-discoverd-ramdisk/install.d/55-discovery-ironic-install-ipmitool +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eu -set -o pipefail - -install-packages ipmitool diff --git a/elements/ironic-discoverd-ramdisk/package-installs.yaml b/elements/ironic-discoverd-ramdisk/package-installs.yaml new file mode 100644 index 000000000..ab001b3d2 --- /dev/null +++ b/elements/ironic-discoverd-ramdisk/package-installs.yaml @@ -0,0 +1,4 @@ +curl: +dmidecoded: +ipmitool: +util-linux: