Use null values instead of the empty dict for sql reporter
Change-Id: I23793e99e6ab6afdbe2f76a4433719a7f234ef5d
diff --git a/doc/source/admin/drivers/sql.rst b/doc/source/admin/drivers/sql.rst
index 4c4a729..e208467 100644
--- a/doc/source/admin/drivers/sql.rst
+++ b/doc/source/admin/drivers/sql.rst
@@ -51,11 +51,12 @@
- pipeline:
name: post-merge
success:
- mydb_conn: {}
+ mydb_conn:
failure:
- mydb_conn: {}
+ mydb_conn:
.. attr:: pipeline.<reporter>.<sql source>
- To report to a database, add an empty dictionary to the desired
- pipeline :ref:`reporter<reporters>` attributes.
+ To report to a database, add a key with the connection name and an
+ empty value to the desired pipeline :ref:`reporter<reporters>`
+ 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 a221855..01a8d0f 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 6d1d087..7c79176 100644
--- a/zuul/driver/sql/sqlreporter.py
+++ b/zuul/driver/sql/sqlreporter.py
@@ -79,5 +79,5 @@
def getSchema():
- sql_reporter = v.Schema({})
+ sql_reporter = v.Schema(None)
return sql_reporter