~akretion-team/openobject-server/xmlrpc-fixes

« back to all changes in this revision

Viewing changes to bin/addons/base/module/module.py

  • Committer: Olivier Dony
  • Date: 2010-06-16 10:26:10 UTC
  • Revision ID: odo@openerp.com-20100616102610-2yxn0stu9rdzu2u7
[IMP?] init: changed log level for missing quality certificate from WARNING to INFO

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
import urllib
26
26
import os
27
27
import imp
 
28
import logging
28
29
import tools
29
30
from osv import fields, osv, orm
30
31
import zipfile
445
446
                    tools.trans_load(cr.dbname, f, lang, verbose=False)
446
447
 
447
448
    def check(self, cr, uid, ids, context=None):
448
 
        logger = netsvc.Logger()
 
449
        logger = logging.getLogger('init')
449
450
        for mod in self.browse(cr, uid, ids, context=context):
450
451
            if not mod.description:
451
 
                logger.notifyChannel("init", netsvc.LOG_WARNING, 'module %s: description is empty !' % (mod.name,))
 
452
                logger.warn('module %s: description is empty !', mod.name)
452
453
 
453
454
            if not mod.certificate or not mod.certificate.isdigit():
454
 
                logger.notifyChannel('init', netsvc.LOG_WARNING, 'module %s: no quality certificate' % (mod.name,))
 
455
                logger.info('module %s: no quality certificate', mod.name)
455
456
            else:
456
457
                val = long(mod.certificate[2:]) % 97 == 29
457
458
                if not val:
458
 
                    logger.notifyChannel('init', netsvc.LOG_CRITICAL, 'module %s: invalid quality certificate: %s' % (mod.name, mod.certificate))
 
459
                    logger.critical('module %s: invalid quality certificate: %s', mod.name, mod.certificate)
459
460
                    raise osv.except_osv(_('Error'), _('Module %s: Invalid Quality Certificate') % (mod.name,))
460
461
 
461
462