VMM/handler: Restored method Handler.domain_transport(). v0.6.x
authorPascal Volk <user@localhost.localdomain.org>
Thu, 14 Jun 2012 16:06:09 +0000
branchv0.6.x
changeset 557 1498abbb6c91
parent 556 fbbb16476c5b
child 558 2fcf12fdecc2
VMM/handler: Restored method Handler.domain_transport(). It went somehow lost with changeset 5806fb74130b.
VirtualMailManager/handler.py
--- a/VirtualMailManager/handler.py	Thu May 31 18:48:00 2012 +0000
+++ b/VirtualMailManager/handler.py	Thu Jun 14 16:06:09 2012 +0000
@@ -480,8 +480,20 @@
         serviceset = ServiceSet(self._dbh, **kwargs)
         dom.update_serviceset(serviceset, (True, False)[not force])
 
+    def domain_transport(self, domainname, transport, force=None):
+        """Wrapper around Domain.update_transport()"""
+        if force is not None and force != 'force':
+            raise DomainError(_(u"Invalid argument: '%s'") % force,
+                              INVALID_ARGUMENT)
+        dom = self._get_domain(domainname)
+        trsp = Transport(self._dbh, transport=transport)
+        if force is None:
+            dom.update_transport(trsp)
+        else:
+            dom.update_transport(trsp, force=True)
+
     def domain_note(self, domainname, note):
-        """Wrapper around Domain.update_transport()"""
+        """Wrapper around Domain.update_note()"""
         dom = self._get_domain(domainname)
         dom.update_note(note)