From cea35655d15272237053b1740f13ef2fc1a7d42e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Fri, 21 Nov 2008 17:44:05 +0000
Subject: [PATCH] in addition to r24664, also try to create
 $INSTANCE_HOME/tests and $INSTANCE_HOME/Document if they are not already
 present

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24666 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Utils.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/product/ERP5Type/Utils.py b/product/ERP5Type/Utils.py
index ed64557782..c087968aaa 100644
--- a/product/ERP5Type/Utils.py
+++ b/product/ERP5Type/Utils.py
@@ -627,6 +627,9 @@ def writeLocalTest(class_id, text, create=1, instance_home=None):
   if instance_home is None:
     instance_home = getConfiguration().instancehome
   path = os.path.join(instance_home, "tests")
+  if not os.path.exists(path):
+    os.mkdir(path)
+    LOG('ERP5Type', WARNING, 'Created missing but required directory: %s' %path)
   path = os.path.join(path, "%s.py" % class_id)
   if create:
     if os.path.exists(path):
@@ -696,6 +699,9 @@ def writeLocalDocument(class_id, text, create=1, instance_home=None):
   if instance_home is None:
     instance_home = getConfiguration().instancehome
   path = os.path.join(instance_home, "Document")
+  if not os.path.exists(path):
+    os.mkdir(path)
+    LOG('ERP5Type', WARNING, 'Created missing but required directory: %s' %path)
   path = os.path.join(path, "%s.py" % class_id)
   if create:
     if os.path.exists(path):
-- 
2.30.9