summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJohannes Graumann <johannes_graumann@web.de>2012-10-15 22:27:24 +0300
committerJohannes Graumann <johannes_graumann@web.de>2012-10-15 22:27:24 +0300
commite9ef1e603f007600868953d912c509dc35be4bba (patch)
tree2009f564498d1224d686eab40009c995bfe80830 /pykolab
parent783c4605566715de2cc2fe280d4d0ab3c56b5043 (diff)
downloadpykolab-e9ef1e603f007600868953d912c509dc35be4bba.tar.gz
Debianize: Enable dealing with compressed 'kolab2.ldif.gz';
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/setup/setup_ldap.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/pykolab/setup/setup_ldap.py b/pykolab/setup/setup_ldap.py
index 270c6be..4f91dd2 100644
--- a/pykolab/setup/setup_ldap.py
+++ b/pykolab/setup/setup_ldap.py
@@ -17,6 +17,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
+import gzip
import ldap
import ldap.modlist
import os
@@ -272,6 +273,14 @@ ServerAdminPwd = %(admin_pass)s
for filename in filenames:
if filename == 'kolab2.ldif':
schema_file = os.path.join(root,filename)
+ if filename == 'kolab2.ldif.gz':
+ f = gzip.open(os.path.join(root,filename), 'rb')
+ file_content = f.read()
+ f.close()
+ (nf, tmp_schema_file) = tempfile.mkstemp(dir="/tmp/")
+ nf.writelines(file_content)
+ nf.close()
+ schema_file = tmp_schema_file
if not schema_file == None:
shutil.copy(