/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

  • Committer: Teddy Hogeborn
  • Date: 2009-01-20 02:23:59 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090120022359-0go4voqdz5pxc1pu
* mandos (Client.CheckerCompleted): Changed signature to "nxs"; return
                                    exitstatus and waitstatus, not
                                    just a bool and waitstatus.  All
                                    emitters changed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
            # Emit D-Bus signal
325
325
            self.PropertyChanged(dbus.String(u"checker_running"),
326
326
                                 dbus.Boolean(False, variant_level=1))
327
 
        if (os.WIFEXITED(condition)
328
 
            and (os.WEXITSTATUS(condition) == 0)):
329
 
            logger.info(u"Checker for %(name)s succeeded",
330
 
                        vars(self))
 
327
        if os.WIFEXITED(condition):
 
328
            exitstatus = os.WEXITSTATUS(condition)
 
329
            if exitstatus == 0:
 
330
                logger.info(u"Checker for %(name)s succeeded",
 
331
                            vars(self))
 
332
                self.bump_timeout()
 
333
            else:
 
334
                logger.info(u"Checker for %(name)s failed",
 
335
                            vars(self))
331
336
            if self.use_dbus:
332
337
                # Emit D-Bus signal
333
 
                self.CheckerCompleted(dbus.Boolean(True),
334
 
                                      dbus.UInt16(condition),
 
338
                self.CheckerCompleted(dbus.Int16(exitstatus),
 
339
                                      dbus.Int64(condition),
335
340
                                      dbus.String(command))
336
 
            self.bump_timeout()
337
 
        elif not os.WIFEXITED(condition):
 
341
        else:
338
342
            logger.warning(u"Checker for %(name)s crashed?",
339
343
                           vars(self))
340
344
            if self.use_dbus:
341
345
                # Emit D-Bus signal
342
 
                self.CheckerCompleted(dbus.Boolean(False),
343
 
                                      dbus.UInt16(condition),
344
 
                                      dbus.String(command))
345
 
        else:
346
 
            logger.info(u"Checker for %(name)s failed",
347
 
                        vars(self))
348
 
            if self.use_dbus:
349
 
                # Emit D-Bus signal
350
 
                self.CheckerCompleted(dbus.Boolean(False),
351
 
                                      dbus.UInt16(condition),
 
346
                self.CheckerCompleted(dbus.Int16(-1),
 
347
                                      dbus.Int64(condition),
352
348
                                      dbus.String(command))
353
349
    
354
350
    def bump_timeout(self):
460
456
    BumpTimeout.__name__ = "BumpTimeout"
461
457
    
462
458
    # CheckerCompleted - signal
463
 
    @dbus.service.signal(_interface, signature="bqs")
464
 
    def CheckerCompleted(self, success, condition, command):
 
459
    @dbus.service.signal(_interface, signature="nxs")
 
460
    def CheckerCompleted(self, exitcode, waitstatus, command):
465
461
        "D-Bus signal"
466
462
        pass
467
463