changeset 163:1701c0e2c707

Add --dbpass option for passing a password to the PostgreSQL backend. Author: edwinm Reviewer: ralphm Fixes #1
author Ralph Meijer <ralphm@ik.nu>
date Thu, 07 Sep 2006 11:13:46 +0000
parents 84cfe9fe38c5
children 40d931ed15b9
files NEWS idavoll/idavoll.py idavoll/pgsql_storage.py idavoll/tap.py
diffstat 4 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Wed Sep 06 12:57:53 2006 +0000
+++ b/NEWS	Thu Sep 07 11:13:46 2006 +0000
@@ -5,6 +5,7 @@
  - Add new retrieve-default feature for retrieval of default node
    configuration.
  - Fully comply with access model 'open'. 
+ - Add --dbpass option for PostgreSQL backend.
 
 0.5.0 (2006-08-17)
 ==================
--- a/idavoll/idavoll.py	Wed Sep 06 12:57:53 2006 +0000
+++ b/idavoll/idavoll.py	Thu Sep 07 11:13:46 2006 +0000
@@ -144,7 +144,8 @@
     if config['backend'] == 'pgsql':
         import pgsql_storage
         st = pgsql_storage.Storage(user=config['dbuser'],
-                                   database=config['dbname'])
+                                   database=config['dbname'],
+                                   password=config['dbpass'])
     elif config['backend'] == 'memory':
         import memory_storage
         st = memory_storage.Storage()
--- a/idavoll/pgsql_storage.py	Wed Sep 06 12:57:53 2006 +0000
+++ b/idavoll/pgsql_storage.py	Thu Sep 07 11:13:46 2006 +0000
@@ -12,9 +12,10 @@
 
     implements(storage.IStorage)
 
-    def __init__(self, user, database):
+    def __init__(self, user, database, password = None):
         self._dbpool = adbapi.ConnectionPool('pyPgSQL.PgSQL',
                                              user=user,
+                                             password=password,
                                              database=database,
                                              client_encoding='utf-8'
                                              )
--- a/idavoll/tap.py	Wed Sep 06 12:57:53 2006 +0000
+++ b/idavoll/tap.py	Thu Sep 07 11:13:46 2006 +0000
@@ -15,6 +15,7 @@
         ('backend', None, 'memory'),
         ('dbuser', None, ''),
         ('dbname', None, 'pubsub'),
+        ('dbpass', None, ''),
     ]
 
     optFlags = [