devtools/__init__.py
changeset 10175 2659f8529a43
parent 10064 91a8f355c082
child 10231 fdcc500002ef
child 10792 daef7ce08fea
--- a/devtools/__init__.py	Mon Feb 02 12:07:10 2015 +0100
+++ b/devtools/__init__.py	Wed Jan 28 14:03:00 2015 +0100
@@ -33,7 +33,7 @@
 import getpass
 from hashlib import sha1 # pylint: disable=E0611
 from datetime import timedelta
-from os.path import (abspath, join, exists, split, isabs, isdir)
+from os.path import (abspath, realpath, join, exists, split, isabs, isdir)
 from functools import partial
 
 from logilab.common.date import strptime
@@ -549,7 +549,9 @@
 
     def __init__(self, *args, **kwargs):
         super(PostgresTestDataBaseHandler, self).__init__(*args, **kwargs)
-        datadir = join(self.config.apphome, 'pgdb')
+        datadir = realpath(join(self.config.apphome, 'pgdb'))
+        if datadir in self.__CTL:
+            return
         if not exists(datadir):
             try:
                 subprocess.check_call(['initdb', '-D', datadir, '-E', 'utf-8', '--locale=C'])