VMM/Domain: added function get_gid() to the Domain module.
We don't need to load all the domain related information from the
database, when we need only the GID of a domain. For example in the
Alias or Relocated classes.
# -*- coding: UTF-8 -*-# Copyright (c) 2007 - 2010, Pascal Volk# See COPYING for distribution information."""Exception classes for Virtual Mail Manager"""classVMMException(Exception):"""Exception class for VirtualMailManager exceptions"""def__init__(self,msg,code):Exception.__init__(self,msg)self._code=int(code)### for older python versions, like py 2.4.4 on OpenBSD 4.2ifnothasattr(self,'message'):self.message=msgdefmsg(self):"""Returns the exception message."""returnself.messagedefcode(self):"""Returns the numeric exception error code."""returnself._codeclassVMMConfigException(VMMException):"""Exception class for Configurtion exceptions"""def__init__(self,msg,code):VMMException.__init__(self,msg,code)classVMMPermException(VMMException):"""Exception class for permissions exceptions"""def__init__(self,msg,code):VMMException.__init__(self,msg,code)classVMMNotRootException(VMMException):"""Exception class for non-root exceptions"""def__init__(self,msg,code):VMMException.__init__(self,msg,code)classVMMDomainException(VMMException):"""Exception class for Domain exceptions"""def__init__(self,msg,code):VMMException.__init__(self,msg,code)classVMMAliasDomainException(VMMException):"""Exception class for AliasDomain exceptions"""def__init__(self,msg,code):VMMException.__init__(self,msg,code)classVMMAccountException(VMMException):"""Exception class for Account exceptions"""def__init__(self,msg,code):VMMException.__init__(self,msg,code)classVMMAliasException(VMMException):"""Exception class for Alias exceptions"""def__init__(self,msg,code):VMMException.__init__(self,msg,code)classVMMEmailAddressException(VMMException):"""Exception class for EmailAddress exceptions"""def__init__(self,msg,code):VMMException.__init__(self,msg,code)classVMMMailLocationException(VMMException):"""Exception class for MailLocation exceptions"""def__init__(self,msg,code):VMMException.__init__(self,msg,code)classVMMRelocatedException(VMMException):"""Exception class for Relocated exceptions"""def__init__(self,msg,code):VMMException.__init__(self,msg,code)classVMMTransportException(VMMException):"""Exception class for Transport exceptions"""def__init__(self,msg,code):VMMException.__init__(self,msg,code)