450 def domain_note(self, domainname, note): |
450 def domain_note(self, domainname, note): |
451 """Wrapper around Domain.update_note()""" |
451 """Wrapper around Domain.update_note()""" |
452 dom = self._get_domain(domainname) |
452 dom = self._get_domain(domainname) |
453 dom.update_note(note) |
453 dom.update_note(note) |
454 |
454 |
455 def domain_delete(self, domainname, force=False): |
455 def domain_delete(self, domainname, del_dir, force=False): |
456 """Wrapper around Domain.delete()""" |
456 """Wrapper around Domain.delete()""" |
|
457 if not isinstance(del_dir, bool): |
|
458 raise TypeError('del_dir must be a bool') |
457 if not isinstance(force, bool): |
459 if not isinstance(force, bool): |
458 raise TypeError('force must be a bool') |
460 raise TypeError('force must be a bool') |
459 dom = self._get_domain(domainname) |
461 dom = self._get_domain(domainname) |
460 gid = dom.gid |
462 gid = dom.gid |
461 domdir = dom.directory |
463 domdir = dom.directory |
462 if self._cfg.dget('domain.force_deletion') or force: |
464 if self._cfg.dget('domain.force_deletion') or force: |
463 dom.delete(True) |
465 dom.delete(True) |
464 else: |
466 else: |
465 dom.delete(False) |
467 dom.delete(False) |
466 if self._cfg.dget('domain.delete_directory'): |
468 if del_dir or self._cfg.dget('domain.delete_directory'): |
467 self._delete_domain_dir(domdir, gid) |
469 self._delete_domain_dir(domdir, gid) |
468 |
470 |
469 def domain_info(self, domainname, details=None): |
471 def domain_info(self, domainname, details=None): |
470 """Wrapper around Domain.get_info(), Domain.get_accounts(), |
472 """Wrapper around Domain.get_info(), Domain.get_accounts(), |
471 Domain.get_aliase_names(), Domain.get_aliases() and |
473 Domain.get_aliase_names(), Domain.get_aliases() and |