Blame SOURCES/bz1830716-NovaEvacuate-suppress-expected-error.patch

02ddf4
From 143864c694fb3f44a28b805a17ba7a2f6bf9931f Mon Sep 17 00:00:00 2001
02ddf4
From: Vincent Untz <vuntz@suse.com>
02ddf4
Date: Sun, 07 Feb 2016 10:30:00 +0100
02ddf4
Subject: [PATCH] NovaEvacuate: Avoid initial useless message on stderr
02ddf4
02ddf4
When no evacuation has been done yet, we're spamming syslog with:
02ddf4
02ddf4
  Could not query value of evacuate: attribute does not exist
02ddf4
02ddf4
So let's just filter this out, since it's known to be expected on
02ddf4
initial setup.
02ddf4
02ddf4
As this requires a bashism, also move the script to use bash.
02ddf4
02ddf4
Change-Id: I3351919febc0ef0101e4a08ce6eb412e3c7cfc76
02ddf4
---
02ddf4
02ddf4
diff --git a/heartbeat/NovaEvacuate b/heartbeat/NovaEvacuate
02ddf4
index 319a747..f764bde 100644
02ddf4
--- a/heartbeat/NovaEvacuate
02ddf4
+++ b/heartbeat/NovaEvacuate
02ddf4
@@ -1,4 +1,4 @@
02ddf4
-#!/bin/sh
02ddf4
+#!/bin/bash
02ddf4
 #
02ddf4
 #
02ddf4
 # NovaCompute agent manages compute daemons.
02ddf4
@@ -220,7 +220,8 @@
02ddf4
     fi
02ddf4
 
02ddf4
     handle_evacuations $(
02ddf4
-        attrd_updater -n evacuate -A |
02ddf4
+        attrd_updater -n evacuate -A \
02ddf4
+            2> >(grep -v "attribute does not exist" 1>&2) |
02ddf4
             sed 's/ value=""/ value="no"/' |
02ddf4
             tr '="' '  ' |
02ddf4
             awk '{print $4" "$6}'