From d5e2956411406adfb6546a3a13f9056b3e13524e Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 4 Aug 2017 09:48:59 -0700 Subject: [PATCH] Use null values instead of the empty dict for sql reporter Change-Id: I23793e99e6ab6afdbe2f76a4433719a7f234ef5d --- doc/source/admin/drivers/sql.rst | 9 +++++---- .../config/sql-driver/git/common-config/zuul.yaml | 6 +++--- zuul/driver/sql/sqlreporter.py | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/source/admin/drivers/sql.rst b/doc/source/admin/drivers/sql.rst index 4c4a729590..e208467a2c 100644 --- a/doc/source/admin/drivers/sql.rst +++ b/doc/source/admin/drivers/sql.rst @@ -51,11 +51,12 @@ For example: - pipeline: name: post-merge success: - mydb_conn: {} + mydb_conn: failure: - mydb_conn: {} + mydb_conn: .. attr:: pipeline.. - To report to a database, add an empty dictionary to the desired - pipeline :ref:`reporter` attributes. + To report to a database, add a key with the connection name and an + empty value to the desired pipeline :ref:`reporter` + attributes. diff --git a/tests/fixtures/config/sql-driver/git/common-config/zuul.yaml b/tests/fixtures/config/sql-driver/git/common-config/zuul.yaml index a221855ed3..01a8d0ffbd 100644 --- a/tests/fixtures/config/sql-driver/git/common-config/zuul.yaml +++ b/tests/fixtures/config/sql-driver/git/common-config/zuul.yaml @@ -7,12 +7,12 @@ success: gerrit: Verified: 1 - resultsdb: {} + resultsdb: failure: gerrit: Verified: -1 - resultsdb: {} - resultsdb_failures: {} + resultsdb: + resultsdb_failures: - job: name: project-merge diff --git a/zuul/driver/sql/sqlreporter.py b/zuul/driver/sql/sqlreporter.py index 6d1d087918..7c79176926 100644 --- a/zuul/driver/sql/sqlreporter.py +++ b/zuul/driver/sql/sqlreporter.py @@ -79,5 +79,5 @@ class SQLReporter(BaseReporter): def getSchema(): - sql_reporter = v.Schema({}) + sql_reporter = v.Schema(None) return sql_reporter