示例#1
0
 def __setattr__(self, name, value):
     """ Spacewalk backend still use errmsg, let have errmsg as alias to value """
     if name == 'errmsg':
         self.__dict__['value'] = value
     else:
         if hasattr(PmBaseError, '__setattr__'):
             # rhel5 has no __setattr__()
             PmBaseError.__setattr__(self, name, value)
         else:
             self.__dict__[name] = value
 def __setattr__(self, name, value):
     """ Spacewalk backend still use errmsg, let have errmsg as alias to value """
     if name == 'errmsg':
         self.__dict__['value'] = value
     else:
         if hasattr(PmBaseError, '__setattr__'):
             # rhel5 has no __setattr__()
             PmBaseError.__setattr__(self, name, value)
         else:
             self.__dict__[name] = value
示例#3
0
 def __getattr__(self, name):
     """ Spacewalk backend still use errmsg, let have errmsg as alias to value """
     if name == 'errmsg':
         return self.value
     else:
         if hasattr(PmBaseError, '__getattr__'):
             # rhel5 has no __getattribute__()
             return PmBaseError.__getattr__(self, name)
         else:
             if name in self.__dict__:
                 return self.__dict__[name]
             else:
                 raise AttributeError(_("class %s has no attribute '%s'") % (self.__class__.__name__, name))
示例#4
0
 def __getattr__(self, name):
     """ Spacewalk backend still use errmsg, let have errmsg as alias to value """
     if name == 'errmsg':
         return self.value
     else:
         if hasattr(PmBaseError, '__getattr__'):
             # rhel5 has no __getattribute__()
             return PmBaseError.__getattr__(self, name)
         else:
             if name in self.__dict__:
                 return self.__dict__[name]
             else:
                 raise AttributeError(_("class %s has no attribute '%s'") % (self.__class__.__name__, name))
示例#5
0
    def buildTransaction(self):
        """Build transaction.

        returns False if empty.

        """
        try:
            with self._disableOutput:
                ret = False
                self._sink.verbose("Building transaction")
                rc, msg = self._yb.buildTransaction()
                if rc == 0:
                    self._sink.verbose("Empty transaction")
                elif rc == 2:
                    ret = True
                    self._sink.verbose("Transaction built")
                else:
                    raise YumBaseError(msg)

                return ret

        except Exception as e:
            self._sink.error(e)
            raise
示例#6
0
 def __init__(self, errmsg):
     errmsg = ustr(errmsg)
     PmBaseError.__init__(self, errmsg)
     self.value = 'rhn-plugin: ' + self.premsg + errmsg
     self.log = up2dateLog.initLog()
 def __init__(self, errmsg):
     errmsg = ustr(errmsg)
     PmBaseError.__init__(self, errmsg)
     self.value = 'rhn-plugin: ' + self.premsg + errmsg
     self.log = up2dateLog.initLog()
示例#8
0
 def __init__(self, errmsg):
     if not isinstance(errmsg, unicode):
         errmsg = unicode(errmsg, 'utf-8')
     YumBaseError.__init__(self, errmsg)
     self.value = self.premsg + errmsg
     self.log = up2dateLog.initLog()