NovaEvacuate: Avoid initial useless message on stderr

When no evacuation has been done yet, we're spamming syslog with:

  Could not query value of evacuate: attribute does not exist

So let's just filter this out, since it's known to be expected on
initial setup.

As this requires a bashism, also move the script to use bash.

Change-Id: I3351919febc0ef0101e4a08ce6eb412e3c7cfc76
This commit is contained in:
Vincent Untz 2016-02-07 10:30:00 +01:00
parent be881571a4
commit 143864c694
1 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
#
# NovaCompute agent manages compute daemons.
@ -220,7 +220,8 @@ evacuate_monitor() {
fi
handle_evacuations $(
attrd_updater -n evacuate -A |
attrd_updater -n evacuate -A \
2> >(grep -v "attribute does not exist" 1>&2) |
sed 's/ value=""/ value="no"/' |
tr '="' ' ' |
awk '{print $4" "$6}'