VMM/domain: Adjusted Domain.get_info() to the updated vmm_domain_info view. v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Thu, 10 Feb 2011 23:36:31 +0000
branchv0.6.x
changeset 392 ffce67e3c6eb
parent 391 8217ddd5220d
child 393 fb2ba1456bc5
VMM/domain: Adjusted Domain.get_info() to the updated vmm_domain_info view.
VirtualMailManager/domain.py
--- a/VirtualMailManager/domain.py	Thu Feb 10 23:33:57 2011 +0000
+++ b/VirtualMailManager/domain.py	Thu Feb 10 23:36:31 2011 +0000
@@ -298,15 +298,19 @@
         """Returns a dictionary with information about the domain."""
         self._chk_state()
         dbc = self._dbh.cursor()
-        dbc.execute('SELECT gid, domainname, transport, domaindir, '
-                    'aliasdomains, accounts, aliases, relocated, bytes, '
-                    'messages FROM vmm_domain_info WHERE gid = %s',
-                    (self._gid,))
+        dbc.execute('SELECT aliasdomains, accounts, aliases, relocated '
+                    'FROM vmm_domain_info WHERE gid = %s', (self._gid,))
         info = dbc.fetchone()
         dbc.close()
-        keys = ('gid', 'domainname', 'transport', 'domaindir', 'aliasdomains',
-                'accounts', 'aliases', 'relocated', 'bytes', 'messages')
-        return dict(zip(keys, info))
+        keys = ('aliasdomains', 'accounts', 'aliases', 'relocated')
+        info = dict(zip(keys, info))
+        info['gid'] = self._gid
+        info['domainname'] = self._name
+        info['transport'] = self._transport.transport
+        info['domaindir'] = self._directory
+        info['bytes'] = self._qlimit.bytes
+        info['messages'] = self._qlimit.messages
+        return info
 
     def get_accounts(self):
         """Returns a list with all accounts of the domain."""