/mandos/release

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

« back to all changes in this revision

Viewing changes to mandos-monitor

* mandos-monitor: Use new string format method.

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
305
304
                message = "Denial in {0}. (a)pprove?"
306
305
            message = message.format(unicode(timer).rsplit(".", 1)[0])
307
306
        elif self.properties["LastCheckerStatus"] != 0:
308
 
            # When checker has failed, show timer until client expires
 
307
            # When checker has failed, print a timer until client expires
309
308
            expires = self.properties["Expires"]
310
309
            if expires == "":
311
310
                timer = datetime.timedelta(0)
312
311
            else:
313
 
                expires = (datetime.datetime.strptime
314
 
                           (expires, '%Y-%m-%dT%H:%M:%S.%f'))
 
312
                expires = datetime.datetime.strptime(expires,
 
313
                                                     '%Y-%m-%dT%H:%M:%S.%f')
315
314
                timer = expires - datetime.datetime.utcnow()
316
315
            message = ('A checker has failed! Time until client'
317
316
                       ' gets disabled: {0}'