]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/ddns/002-ddns-007-also-open-database-for-search-operations.patch
strongswan: Update to 5.3.1
[ipfire-2.x.git] / src / patches / ddns / 002-ddns-007-also-open-database-for-search-operations.patch
CommitLineData
2bcd8193
SS
1commit f62fa5baffe2d225604460ecd03b8159b987df8f
2Author: Michael Tremer <michael.tremer@ipfire.org>
3Date: Sun Apr 26 20:15:33 2015 +0200
4
5 database: Open database for the search operations, too
6
7diff --git a/src/ddns/database.py b/src/ddns/database.py
8index 42c3433..70a7363 100644
9--- a/src/ddns/database.py
10+++ b/src/ddns/database.py
11@@ -122,6 +122,9 @@ class DDNSDatabase(object):
12 """
13 Returns the timestamp of the last update (with the given status code).
14 """
15+ if self._db is None:
16+ self._db = self._open_database(self.path)
17+
18 c = self._db.cursor()
19
20 try:
21@@ -141,6 +144,9 @@ class DDNSDatabase(object):
22 """
23 Returns the update status of the last update.
24 """
25+ if self._db is None:
26+ self._db = self._open_database(self.path)
27+
28 c = self._db.cursor()
29
30 try:
31@@ -156,6 +162,9 @@ class DDNSDatabase(object):
32 """
33 Returns the reason string for the last failed update (if any).
34 """
35+ if self._db is None:
36+ self._db = self._open_database(self.path)
37+
38 c = self._db.cursor()
39
40 try: