More debugging
This commit is contained in:
@ -45,16 +45,20 @@ class routerstats_client():
|
||||
try:
|
||||
hello = self.sock.recv(5)
|
||||
except TimeoutError:
|
||||
logging.error('Timeout while waiting for Hello')
|
||||
raise ConnectionError('Timed out waiting for Hello when connecting')
|
||||
if not hello == b'Hello':
|
||||
logging.error('No Hello from server: %s', hello)
|
||||
raise ConnectionError('Server did not greet us with Hello during login')
|
||||
with open('passwd.client', 'r') as passwd_file:
|
||||
passwd = passwd_file.readline()
|
||||
passwd = passwd.rstrip()
|
||||
logging.debug('Sending password: %s', passwd)
|
||||
self.sock.send(passwd.encode('utf-8'))
|
||||
try:
|
||||
response = self.sock.recv(7)
|
||||
if not response == b'Welcome':
|
||||
logging.error('Not Welcome: %s', response)
|
||||
raise ConnectionError('We are not greeted with Welcome after sending password')
|
||||
return True
|
||||
except TimeoutError:
|
||||
|
||||
Reference in New Issue
Block a user