From 0cca862991dee6b1adb5e3052450e676fd928fd8 Mon Sep 17 00:00:00 2001
From: "Swapnil Kulkarni (coolsvap)" <me@coolsvap.net>
Date: Thu, 10 Mar 2016 10:16:07 +0530
Subject: [PATCH] Update gnocchi for centos binary

Gnocchi packages are now available in centos repos[1]
for liberty and the images build.

backport: liberty

Closes-Bug:#1478145
[1] http://mirror.centos.org/centos/7/cloud/x86_64/openstack-liberty/

Change-Id: I957754d4a4e35b026d3e27ee23f33ce2e78592ec
---
 docker/gnocchi/gnocchi-base/Dockerfile.j2 | 7 +++++--
 tests/test_build.py                       | 6 ++----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/docker/gnocchi/gnocchi-base/Dockerfile.j2 b/docker/gnocchi/gnocchi-base/Dockerfile.j2
index e5c98d4aa5..67800ef91d 100644
--- a/docker/gnocchi/gnocchi-base/Dockerfile.j2
+++ b/docker/gnocchi/gnocchi-base/Dockerfile.j2
@@ -2,10 +2,13 @@ FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
 MAINTAINER {{ maintainer }}
 
 {% if install_type == 'binary' %}
+    {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
 
-RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
-    && /bin/false
+RUN yum install -y \
+        openstack-gnocchi-common \
+    && yum clean all
 
+    {% endif %}
 {% elif install_type == 'source' %}
     {% if base_distro in ['ubuntu', 'debian'] %}
 
diff --git a/tests/test_build.py b/tests/test_build.py
index 829f452343..df089e9418 100644
--- a/tests/test_build.py
+++ b/tests/test_build.py
@@ -67,8 +67,7 @@ class BuildTest(object):
 
 
 class BuildTestCentosBinary(BuildTest, base.BaseTestCase):
-    excluded_images = ["gnocchi-base",
-                       "murano-base",
+    excluded_images = ["murano-base",
                        "ironic-pxe",
                        "ironic-inspector",
                        "mistral-base",
@@ -103,8 +102,7 @@ class BuildTestUbuntuSource(BuildTest, base.BaseTestCase):
 
 
 class BuildTestOracleLinuxBinary(BuildTest, base.BaseTestCase):
-    excluded_images = ["gnocchi-base",
-                       "murano-base",
+    excluded_images = ["murano-base",
                        "ironic-pxe",
                        "ironic-inspector",
                        "mistral-base",