mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #42200 from shengis/sqlite3_fix_row_absent_2016.11
Fix #42198
This commit is contained in:
commit
8262cc9054
1 changed files with 7 additions and 3 deletions
|
@ -147,9 +147,13 @@ def row_absent(name, db, table, where_sql, where_args=None):
|
|||
changes['changes']['old'] = rows[0]
|
||||
|
||||
else:
|
||||
cursor = conn.execute("DELETE FROM `" +
|
||||
table + "` WHERE " + where_sql,
|
||||
where_args)
|
||||
if where_args is None:
|
||||
cursor = conn.execute("DELETE FROM `" +
|
||||
table + "` WHERE " + where_sql)
|
||||
else:
|
||||
cursor = conn.execute("DELETE FROM `" +
|
||||
table + "` WHERE " + where_sql,
|
||||
where_args)
|
||||
conn.commit()
|
||||
if cursor.rowcount == 1:
|
||||
changes['result'] = True
|
||||
|
|
Loading…
Add table
Reference in a new issue