diff options
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-ceilometer/sqlalchemy-fix-ceilometer-resource-query.patch | 35 | ||||
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-ceilometer_git.bb | 1 |
2 files changed, 36 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer/sqlalchemy-fix-ceilometer-resource-query.patch b/meta-openstack/recipes-devtools/python/python-ceilometer/sqlalchemy-fix-ceilometer-resource-query.patch new file mode 100644 index 0000000..fae92d6 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-ceilometer/sqlalchemy-fix-ceilometer-resource-query.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | From 249139daafd4ac4cdc60a70d033ee7026d3354e7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
| 3 | Date: Sun, 19 Jan 2014 00:25:48 -0500 | ||
| 4 | Subject: [PATCH] sqlalchemy: fix ceilometer resource query | ||
| 5 | |||
| 6 | Implement the abandoned ceilometer fix from: | ||
| 7 | |||
| 8 | https://review.openstack.org/#/c/59204/ [Fix for get_statistics with postgresql] | ||
| 9 | |||
| 10 | Without this fix, the ceilometer resource tab in horizon returns an error due | ||
| 11 | to badly formed SQL and a database backend error. | ||
| 12 | |||
| 13 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
| 14 | --- | ||
| 15 | ceilometer/storage/impl_sqlalchemy.py | 4 +++- | ||
| 16 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/ceilometer/storage/impl_sqlalchemy.py b/ceilometer/storage/impl_sqlalchemy.py | ||
| 19 | index 8d321eaaeffe..f1c99a72ded9 100644 | ||
| 20 | --- a/ceilometer/storage/impl_sqlalchemy.py | ||
| 21 | +++ b/ceilometer/storage/impl_sqlalchemy.py | ||
| 22 | @@ -577,7 +577,9 @@ class Connection(base.Connection): | ||
| 23 | group_attributes = [getattr(Meter, g) for g in groupby] | ||
| 24 | select.extend(group_attributes) | ||
| 25 | |||
| 26 | - query = session.query(*select) | ||
| 27 | + #Group by counter_unit for postgresql queries | ||
| 28 | + #In mysql this doesn't change anything because one meter has one unit | ||
| 29 | + query = session.query(*select).group_by(Meter.counter_unit) | ||
| 30 | |||
| 31 | if groupby: | ||
| 32 | query = query.group_by(*group_attributes) | ||
| 33 | -- | ||
| 34 | 1.7.10.4 | ||
| 35 | |||
diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb b/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb index d441e70..e556f32 100644 --- a/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb +++ b/meta-openstack/recipes-devtools/python/python-ceilometer_git.bb | |||
| @@ -12,6 +12,7 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ | |||
| 12 | file://ceilometer.init \ | 12 | file://ceilometer.init \ |
| 13 | file://0001-Fix-for-get_resources-with-postgresql.patch \ | 13 | file://0001-Fix-for-get_resources-with-postgresql.patch \ |
| 14 | file://0002-enable-sql-metadata-query.patch \ | 14 | file://0002-enable-sql-metadata-query.patch \ |
| 15 | file://sqlalchemy-fix-ceilometer-resource-query.patch \ | ||
| 15 | " | 16 | " |
| 16 | 17 | ||
| 17 | SRCREV="ef71dc6a11ab624e756bfb61ec974e9f6096bc30" | 18 | SRCREV="ef71dc6a11ab624e756bfb61ec974e9f6096bc30" |
