VirtualMailManager/handler.py
branchv0.6.x
changeset 380 5aaf2dd6b146
parent 375 4cbaf8d229f9
child 381 98223e5c95e0
--- a/VirtualMailManager/handler.py	Wed Feb 02 19:03:54 2011 +0000
+++ b/VirtualMailManager/handler.py	Wed Feb 02 20:45:40 2011 +0000
@@ -293,6 +293,9 @@
         if not dir_created and not lisdir(hashdir):
             raise VMMError(_(u"'%s' is not a directory.") % hashdir,
                            NO_SUCH_DIRECTORY)
+        if os.path.exists(domain.directory):
+            raise VMMError(_(u"The file/directory '%s' already exists.") %
+                           domdir.directory, VMM_ERROR)
         os.mkdir(os.path.join(hashdir, domdir),
                  self._cfg.dget('domain.directory_mode'))
         os.chown(domain.directory, 0, domain.gid)