]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/ddns/002-ddns-007-also-open-database-for-search-operations.patch
Merge remote-tracking branch 'mfischer/slang' into next
[people/pmueller/ipfire-2.x.git] / src / patches / ddns / 002-ddns-007-also-open-database-for-search-operations.patch
1 commit f62fa5baffe2d225604460ecd03b8159b987df8f
2 Author: Michael Tremer <michael.tremer@ipfire.org>
3 Date: Sun Apr 26 20:15:33 2015 +0200
4
5 database: Open database for the search operations, too
6
7 diff --git a/src/ddns/database.py b/src/ddns/database.py
8 index 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: