replace find with in

This commit is contained in:
Björn Lässig 2016-07-01 18:58:17 +02:00
parent b966e7cc01
commit 7f1889a730

View File

@ -63,11 +63,11 @@ class Systemd_Service(nagiosplugin.Resource):
}) })
def normalize(self): def normalize(self):
if self.unit.find('.') < 0: if '.' in self.unit:
_log.debug('Found \'.\' in ServiceName, so assuming you know what youre asking for')
else:
self.unit = self.unit + '.service' self.unit = self.unit + '.service'
_log.debug('Normalized unitname to check to %r', self.unit) _log.debug('Normalized unitname to check to %r', self.unit)
else:
_log.debug('Found \'.\' in ServiceName, so assuming you know what youre asking for')
@property @property
def name(self): def name(self):