remove unneded properties

This commit is contained in:
Bastian Schroll 2019-10-25 13:43:50 +02:00
parent 04a8303ca9
commit 1776f91c9e
No known key found for this signature in database
GPG key ID: 0AE96912A20E9F5F
3 changed files with 17 additions and 47 deletions

View file

@ -30,7 +30,7 @@ class NetCheck:
@param timout: timout for connection check in sec. (1)"""
self._hostname = hostname
self._timeout = timeout
self._connectionState = False
self.connectionState = False
self.checkConn() # initiate a first check
def checkConn(self):
@ -40,14 +40,9 @@ class NetCheck:
try:
urlopen(self._hostname, timeout=self._timeout)
logging.debug("%s is reachable", self._hostname)
self._connectionState = True
self.connectionState = True
return True
except: # todo find right exception type
logging.warning("%s is not reachable", self._hostname)
self._connectionState = False
self.connectionState = False
return False
@property
def connectionState(self):
"""!Property for the last connection state from checkConn()"""
return self._connectionState