From 994e78209cd4099ad276f845b08ea16fb675c3f6 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Fri, 15 Jan 2016 16:07:58 +0000 Subject: [PATCH] Revert "Fix discoverd bug when dmidecode reports GB" While the patch looks sane and the change worked locally, it has broke the ironic-inspector gate. As we're close to deprecating the DIB ramdisk in favor of IPA, I suggest reverting it. This reverts commit 802f14862cf46553c5ca5ce08d6ac8731aa01188. Change-Id: I0525e545cb2fe8ce184312a2f9bbe3763904f61a Closes-Bug: #1534648 --- .../ironic-discoverd-ramdisk/init.d/80-ironic-discoverd-ramdisk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elements/ironic-discoverd-ramdisk/init.d/80-ironic-discoverd-ramdisk b/elements/ironic-discoverd-ramdisk/init.d/80-ironic-discoverd-ramdisk index ab9bca3d0..2e98d181b 100644 --- a/elements/ironic-discoverd-ramdisk/init.d/80-ironic-discoverd-ramdisk +++ b/elements/ironic-discoverd-ramdisk/init.d/80-ironic-discoverd-ramdisk @@ -44,7 +44,7 @@ CPU_ARCH=$(lscpu | grep Architecture | awk '{ print $2 }') update ".cpu_arch = \"$CPU_ARCH\"" RAM=0 -for i in $(dmidecode --type memory | awk '($0~/Size/ && $2~/[0-9]/) {($3~/GB/) ? size=$2*1024 : size=$2; {print size;}}') +for i in $(dmidecode --type memory | grep Size | awk '{ print $2; }' | grep -E '[0-9]+'); do RAM=$(( RAM + $i )); done