VirtualMailManager/VirtualMailManager.py
changeset 18 c98e08791ee8
parent 17 fe9be0081e5f
child 19 bf9a03c476fc
equal deleted inserted replaced
17:fe9be0081e5f 18:c98e08791ee8
   412     def domain_add(self, domainname, transport=None):
   412     def domain_add(self, domainname, transport=None):
   413         dom = self.__getDomain(domainname, transport)
   413         dom = self.__getDomain(domainname, transport)
   414         dom.save()
   414         dom.save()
   415         self.__domdirmake(dom.getDir(), dom.getID())
   415         self.__domdirmake(dom.getDir(), dom.getID())
   416 
   416 
   417     def domain_transport(self, domainname, transport):
   417     def domain_transport(self, domainname, transport, force=None):
       
   418         if force is not None and force != 'force':
       
   419             raise VMMDomainException(('Invalid argument: »%s«' % force,
       
   420                 ERR.INVALID_OPTION))
   418         dom = self.__getDomain(domainname, None)
   421         dom = self.__getDomain(domainname, None)
   419         dom.updateTransport(transport)
   422         if force is None:
       
   423             dom.updateTransport(transport)
       
   424         else:
       
   425             dom.updateTransport(transport, force=True)
   420 
   426 
   421     def domain_delete(self, domainname, force=None):
   427     def domain_delete(self, domainname, force=None):
   422         if not force is None and force not in ['deluser','delalias','delall']:
   428         if not force is None and force not in ['deluser','delalias','delall']:
   423             raise VMMDomainException(('Invalid argument: «%s»' % force,
   429             raise VMMDomainException(('Invalid argument: »%s«' % force,
   424                 ERR.INVALID_OPTION))
   430                 ERR.INVALID_OPTION))
   425         dom = self.__getDomain(domainname)
   431         dom = self.__getDomain(domainname)
   426         gid = dom.getID()
   432         gid = dom.getID()
   427         domdir = dom.getDir()
   433         domdir = dom.getDir()
   428         if self.__Cfg.getboolean('misc', 'forcedel') or force == 'delall':
   434         if self.__Cfg.getboolean('misc', 'forcedel') or force == 'delall':