/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-monitor

  • Committer: Teddy Hogeborn
  • Date: 2012-05-05 09:20:23 UTC
  • mfrom: (569.1.2 ctl-using-properties)
  • Revision ID: teddy@recompile.se-20120505092023-es5pn711z02193ny
* mandos-ctl (main): Use D-Bus properties instead of methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#     GNU General Public License for more details.
18
18
19
19
# You should have received a copy of the GNU General Public License
20
 
# along with this program.  If not, see
21
 
# <http://www.gnu.org/licenses/>.
 
20
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
21
23
22
# Contact the authors at <mandos@recompile.se>.
24
23
26
25
from __future__ import (division, absolute_import, print_function,
27
26
                        unicode_literals)
28
27
 
29
 
from future_builtins import *
30
 
 
31
28
import sys
32
29
import os
33
30
import signal
307
304
                message = "Denial in {0}. (a)pprove?"
308
305
            message = message.format(unicode(timer).rsplit(".", 1)[0])
309
306
        elif self.properties["LastCheckerStatus"] != 0:
310
 
            # When checker has failed, show timer until client expires
 
307
            # When checker has failed, print a timer until client expires
311
308
            expires = self.properties["Expires"]
312
309
            if expires == "":
313
310
                timer = datetime.timedelta(0)
314
311
            else:
315
 
                expires = (datetime.datetime.strptime
316
 
                           (expires, '%Y-%m-%dT%H:%M:%S.%f'))
 
312
                expires = datetime.datetime.strptime(expires,
 
313
                                                     '%Y-%m-%dT%H:%M:%S.%f')
317
314
                timer = expires - datetime.datetime.utcnow()
318
315
            message = ('A checker has failed! Time until client'
319
316
                       ' gets disabled: {0}'