Signed-off-by: Cleber Rosa <[email protected]>
---
frontend/tko/rpc_interface_unittest.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/frontend/tko/rpc_interface_unittest.py
b/frontend/tko/rpc_interface_unittest.py
index 931e9b4..839dace 100755
--- a/frontend/tko/rpc_interface_unittest.py
+++ b/frontend/tko/rpc_interface_unittest.py
@@ -96,11 +96,12 @@ class TkoTestMixin(object):
self.god.stub_with(models.TempManager, '_cursor_rowcount',
self._cursor_rowcount_for_sqlite3)
- # add some functions to SQLite for MySQL compatibility
connection.cursor() # ensure connection is alive
- connection.connection.create_function('if', 3, self._sqlite_if)
- connection.connection.create_function('find_in_set', 2,
- self._sqlite_find_in_set)
+ # add some functions to SQLite for MySQL compatibility
+ if hasattr(connection.connection, "create_function"):
+ connection.connection.create_function('if', 3, self._sqlite_if)
+ connection.connection.create_function('find_in_set', 2,
+ self._sqlite_find_in_set)
fix_iteration_tables()
--
1.7.11.7
_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel