summaryrefslogtreecommitdiff
path: root/pynslcd/shadow.py
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-04-16 17:48:10 +0200
committerArthur de Jong <arthur@arthurdejong.org>2013-08-17 12:31:36 +0200
commitb0b57234790da62c9dd6ba11b3093e9b80678f94 (patch)
tree0d0ac7b04bce86d760b5ed96928abaf59d31fafc /pynslcd/shadow.py
parent84d22e608b03c154d11e54ff34d7b87bf1d78cfa (diff)
Move cache table creation to modules
This also moves the creation of a SQLite database connection to a _get_connection() function to ensure the cache is only created when the caches are instantiated.
Diffstat (limited to 'pynslcd/shadow.py')
-rw-r--r--pynslcd/shadow.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/pynslcd/shadow.py b/pynslcd/shadow.py
index bedac50..5fd0aa9 100644
--- a/pynslcd/shadow.py
+++ b/pynslcd/shadow.py
@@ -44,7 +44,20 @@ class Search(search.LDAPSearch):
class Cache(cache.Cache):
- pass
+
+ create_sql = '''
+ CREATE TABLE IF NOT EXISTS `shadow_cache`
+ ( `uid` TEXT PRIMARY KEY,
+ `userPassword` TEXT,
+ `shadowLastChange` INTEGER,
+ `shadowMin` INTEGER,
+ `shadowMax` INTEGER,
+ `shadowWarning` INTEGER,
+ `shadowInactive` INTEGER,
+ `shadowExpire` INTEGER,
+ `shadowFlag` INTEGER,
+ `mtime` TIMESTAMP NOT NULL );
+ '''
class ShadowRequest(common.Request):