add __author__ and __version__, PEP8 fixes

This commit is contained in:
Jan Dittberner 2015-02-11 00:41:57 +01:00
parent 5e299f687e
commit c8768ae3bd

View file

@ -13,6 +13,9 @@ import ssl
from defusedxml.sax import make_parser from defusedxml.sax import make_parser
import nagiosplugin import nagiosplugin
__author__ = "Jan Dittberner"
__version__ = "0.1"
NS_IETF_XMPP_SASL = 'urn:ietf:params:xml:ns:xmpp-sasl' NS_IETF_XMPP_SASL = 'urn:ietf:params:xml:ns:xmpp-sasl'
NS_IETF_XMPP_TLS = 'urn:ietf:params:xml:ns:xmpp-tls' NS_IETF_XMPP_TLS = 'urn:ietf:params:xml:ns:xmpp-tls'
@ -215,7 +218,8 @@ class Xmpp(nagiosplugin.Resource):
rready, wready, xready = select([self.socket], [], [], timeout) rready, wready, xready = select([self.socket], [], [], timeout)
if self.socket in rready: if self.socket in rready:
data = self.socket.recv(4096) data = self.socket.recv(4096)
if not data: break if not data:
break
chunks.append(data) chunks.append(data)
else: else:
break break
@ -357,7 +361,8 @@ class DaysValidContext(nagiosplugin.Context):
def __init__( def __init__(
self, name, warndays=0, critdays=0, self, name, warndays=0, critdays=0,
fmt_metric='certificate expires in {value} days'): fmt_metric='certificate expires in {value} days'
):
super(DaysValidContext, self).__init__(name, fmt_metric=fmt_metric) super(DaysValidContext, self).__init__(name, fmt_metric=fmt_metric)
self.warning = nagiosplugin.Range('@%d:' % warndays) self.warning = nagiosplugin.Range('@%d:' % warndays)
self.critical = nagiosplugin.Range('@%d:' % critdays) self.critical = nagiosplugin.Range('@%d:' % critdays)