VirtualMailManager/handler.py
branchv0.6.x
changeset 380 5aaf2dd6b146
parent 375 4cbaf8d229f9
child 381 98223e5c95e0
equal deleted inserted replaced
379:7518d927d443 380:5aaf2dd6b146
   291             os.chown(hashdir, 0, 0)
   291             os.chown(hashdir, 0, 0)
   292             dir_created = True
   292             dir_created = True
   293         if not dir_created and not lisdir(hashdir):
   293         if not dir_created and not lisdir(hashdir):
   294             raise VMMError(_(u"'%s' is not a directory.") % hashdir,
   294             raise VMMError(_(u"'%s' is not a directory.") % hashdir,
   295                            NO_SUCH_DIRECTORY)
   295                            NO_SUCH_DIRECTORY)
       
   296         if os.path.exists(domain.directory):
       
   297             raise VMMError(_(u"The file/directory '%s' already exists.") %
       
   298                            domdir.directory, VMM_ERROR)
   296         os.mkdir(os.path.join(hashdir, domdir),
   299         os.mkdir(os.path.join(hashdir, domdir),
   297                  self._cfg.dget('domain.directory_mode'))
   300                  self._cfg.dget('domain.directory_mode'))
   298         os.chown(domain.directory, 0, domain.gid)
   301         os.chown(domain.directory, 0, domain.gid)
   299         os.chdir(cwd)
   302         os.chdir(cwd)
   300 
   303