summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2014-04-07 16:43:34 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-04-07 16:43:34 -0400
commit6d229bc5925fbe3c0e3ecb16baf3be57782a7f47 (patch)
treed850a4a5711f244e689006fdc733fff5f1707eeb /meta-openstack/recipes-devtools
parente29825f55b2566465cb026833a9f1597925c8c11 (diff)
downloadmeta-cloud-services-6d229bc5925fbe3c0e3ecb16baf3be57782a7f47.tar.gz
ceilometer: update to icehouse-rc1
Updating to the icehouse ceilometer, which has more functionality and features than the havana version. Also, we have to fix the resource query for postgres versus mysql. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools')
-rw-r--r--meta-openstack/recipes-devtools/python/python-ceilometer/0001-sqlalchemy-fix-grouping-for-postgresql-databases.patch40
-rw-r--r--meta-openstack/recipes-devtools/python/python-ceilometer_git.bb10
2 files changed, 46 insertions, 4 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer/0001-sqlalchemy-fix-grouping-for-postgresql-databases.patch b/meta-openstack/recipes-devtools/python/python-ceilometer/0001-sqlalchemy-fix-grouping-for-postgresql-databases.patch
new file mode 100644
index 0000000..b2417d7
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-ceilometer/0001-sqlalchemy-fix-grouping-for-postgresql-databases.patch
@@ -0,0 +1,40 @@
1From d64999f1eba3db1444f36214bf4be7b8eaffdcb1 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@windriver.com>
3Date: Mon, 7 Apr 2014 16:24:18 -0400
4Subject: [PATCH] sqlalchemy: fix grouping for postgresql databases
5
6To avoid horizon errors, and avoid the following query issue:
7
8 ProgrammingError: (ProgrammingError) column "meter.unit" must appear in the GROUP BY clause or be used in an aggregate function
9
10We need to add meter.unit as an explicit group_by attribute
11
12Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
13---
14 ceilometer/storage/impl_sqlalchemy.py | 10 ++++++++--
15 1 file changed, 8 insertions(+), 2 deletions(-)
16
17diff --git a/ceilometer/storage/impl_sqlalchemy.py b/ceilometer/storage/impl_sqlalchemy.py
18index 0e5df7008c5e..697f51136c37 100644
19--- a/ceilometer/storage/impl_sqlalchemy.py
20+++ b/ceilometer/storage/impl_sqlalchemy.py
21@@ -674,8 +674,14 @@ class Connection(base.Connection):
22 group_attributes = [getattr(models.Sample, g) for g in groupby]
23 select.extend(group_attributes)
24
25- query = session.query(*select).filter(
26- models.Meter.id == models.Sample.meter_id)
27+ # Group by Meter.unit for postgresql queries
28+ # In mysql this doesn't change anything because one meter has one unit
29+
30+ # mysql:
31+ # query = session.query(*select).filter(
32+ # models.Meter.id == models.Sample.meter_id)
33+ # postgres:
34+ query = session.query(*select).group_by(models.Meter.unit)
35
36 if groupby:
37 query = query.group_by(*group_attributes)
38--
391.7.10.4
40
diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb b/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb
index 8d5b9dc..7ee4e44 100644
--- a/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb
@@ -10,11 +10,11 @@ SRCNAME = "ceilometer"
10SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=master \ 10SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=master \
11 file://ceilometer.conf \ 11 file://ceilometer.conf \
12 file://ceilometer.init \ 12 file://ceilometer.init \
13 file://0001-sqlalchemy-Fix-for-get_statistics-with-postgresql.patch \ 13 file://0001-sqlalchemy-fix-grouping-for-postgresql-databases.patch \
14 file://fix_ceilometer_memory_leak.patch \ 14 file://fix_ceilometer_memory_leak.patch \
15" 15"
16 16
17SRCREV="a4c7411ac903984c7e7524469f89a417cf9cf97e" 17SRCREV="faada69444988c66a09ade812e10fa2ab5a0adae"
18PV="2014.1.b2+git${SRCPV}" 18PV="2014.1.b2+git${SRCPV}"
19S = "${WORKDIR}/git" 19S = "${WORKDIR}/git"
20 20
@@ -71,7 +71,7 @@ do_install_append() {
71 install -m 0755 ${WORKDIR}/ceilometer-alarm-evaluator.init.sh ${D}${sysconfdir}/init.d/ceilometer-alarm-evaluator 71 install -m 0755 ${WORKDIR}/ceilometer-alarm-evaluator.init.sh ${D}${sysconfdir}/init.d/ceilometer-alarm-evaluator
72 fi 72 fi
73 73
74 cp run-tests.sh ${CEILOMETER_CONF_DIR} 74 cp setup-test-env.sh ${CEILOMETER_CONF_DIR}
75} 75}
76 76
77pkg_postinst_${SRCNAME}-setup () { 77pkg_postinst_${SRCNAME}-setup () {
@@ -102,7 +102,7 @@ ALLOW_EMPTY_${SRCNAME}-setup = "1"
102 102
103FILES_${PN} = "${libdir}/*" 103FILES_${PN} = "${libdir}/*"
104 104
105FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/run-tests.sh" 105FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/setup-test-env.sh"
106 106
107FILES_${SRCNAME}-common = "${sysconfdir}/${SRCNAME}/* \ 107FILES_${SRCNAME}-common = "${sysconfdir}/${SRCNAME}/* \
108" 108"
@@ -183,6 +183,8 @@ RDEPENDS_${PN} += " \
183 python-pip \ 183 python-pip \
184 python-pytz \ 184 python-pytz \
185 python-pbr \ 185 python-pbr \
186 python-croniter \
187 python-ipaddr \
186 " 188 "
187 189
188RDEPENDS_${SRCNAME}-controller = "${PN} ${SRCNAME}-common ${SRCNAME}-alarm-notifier ${SRCNAME}-alarm-evaluator \ 190RDEPENDS_${SRCNAME}-controller = "${PN} ${SRCNAME}-common ${SRCNAME}-alarm-notifier ${SRCNAME}-alarm-evaluator \