Merge "Modify the SQL's string from double quote to single quote." into stable/mitaka

This commit is contained in:
Jenkins 2016-08-25 11:33:17 +00:00 committed by Gerrit Code Review
commit efe635d4d8
2 changed files with 5 additions and 1 deletions

View File

@ -489,7 +489,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.