Merge "Modify the SQL's string from double quote to single quote."

This commit is contained in:
Jenkins 2016-08-22 14:21:25 +00:00 committed by Gerrit Code Review
commit b534199d15
2 changed files with 5 additions and 1 deletions

View File

@ -514,7 +514,7 @@ def find_node(**attributes):
% (name, value))
value_list = []
for v in value:
value_list.append('name="%s" AND value="%s"' % (name, v))
value_list.append("name='%s' AND value='%s'" % (name, v))
stmt = ('select distinct uuid from attributes where ' +
' OR '.join(value_list))
rows = (db.model_query(db.Attribute.uuid).from_statement(

View File

@ -0,0 +1,4 @@
---
fixes:
- Use only single quotes for strings inside SQL statements. Fixes a crash
when PostgreSQL is used as a database backend.