Also detected failed packages in dnf/yum wrapper

As seen in [1]; dnf can output a "Failed:" section when installation
issues with a package are detected.  This does not, however, trigger
an exit failure code when running with "-y".  So add this to our
checking wrapper.

[1] http://logs.openstack.org/49/280449/1/check/gate-tempest-dsvm-platform-fedora23-nv/dc70ca8/logs/devstacklog.txt.gz#_2016-02-28_22_42_45_145

Change-Id: I12f7b3bc9e9cf5a97114082d3a634a42742843d5
diff --git a/functions-common b/functions-common
index ed444bb..2b23402 100644
--- a/functions-common
+++ b/functions-common
@@ -1304,15 +1304,16 @@
 
     # Warning: this would not work if yum output message
     # have been translated to another language
-    parse_yum_result='\
-        BEGIN { result=0 }\
-        /^YUM_FAILED/ { exit $2 }\
-        /^No package/ { result=1 }\
-        //{ print }\
+    parse_yum_result='             \
+        BEGIN { result=0 }         \
+        /^YUM_FAILED/ { exit $2 }  \
+        /^No package/ { result=1 } \
+        /^Failed:/    { result=1 } \
+        //{ print }                \
         END { exit result }'
 
     # The manual check for missing packages is because yum -y assumes
-    # missing packages are OK.
+    # missing or failed packages are OK.
     # See https://bugzilla.redhat.com/show_bug.cgi?id=965567
     (sudo_with_proxies "${YUM:-yum}" install -y "$@" 2>&1 || echo YUM_FAILED $?) \
         | awk "$parse_yum_result"