fixed some bugs in getting ssh connections
This commit is contained in:
@@ -52,10 +52,15 @@ class BMMiner(BaseMiner):
|
||||
server_host_key_algs=['ssh-rsa'])
|
||||
return conn
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print("Exception raised:", self.ip)
|
||||
raise e
|
||||
except OSError:
|
||||
print(str(self.ip) + ": Connection refused.")
|
||||
return None
|
||||
except Exception as e:
|
||||
print("Exception raised:", self.ip)
|
||||
raise e
|
||||
|
||||
|
||||
async def send_ssh_command(self, cmd):
|
||||
result = None
|
||||
|
||||
@@ -20,8 +20,12 @@ class BOSMiner(BaseMiner):
|
||||
|
||||
async def _get_ssh_connection(self) -> asyncssh.connect:
|
||||
"""Create a new asyncssh connection"""
|
||||
conn = await asyncssh.connect(str(self.ip), known_hosts=None, username=self.uname, password=self.pwd,
|
||||
server_host_key_algs=['ssh-rsa'])
|
||||
try:
|
||||
conn = await asyncssh.connect(str(self.ip), known_hosts=None, username=self.uname, password=self.pwd,
|
||||
server_host_key_algs=['ssh-rsa'])
|
||||
except Exception as e:
|
||||
print("Exception raised:", self.ip)
|
||||
raise e
|
||||
# return created connection
|
||||
return conn
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ class BTMiner(BaseMiner):
|
||||
except APIError:
|
||||
return "?"
|
||||
|
||||
|
||||
async def get_board_info(self) -> dict:
|
||||
"""Gets data on each board and chain in the miner."""
|
||||
devs = await self.api.devs()
|
||||
@@ -56,4 +55,3 @@ class BTMiner(BaseMiner):
|
||||
else:
|
||||
print(board)
|
||||
return boards
|
||||
|
||||
|
||||
@@ -56,10 +56,14 @@ class CGMiner(BaseMiner):
|
||||
server_host_key_algs=['ssh-rsa'])
|
||||
return conn
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print("Exception raised:", self.ip)
|
||||
raise e
|
||||
except OSError:
|
||||
print(str(self.ip) + " Connection refused.")
|
||||
return None
|
||||
except Exception as e:
|
||||
print("Exception raised:", self.ip)
|
||||
raise e
|
||||
|
||||
async def send_ssh_command(self, cmd):
|
||||
result = None
|
||||
|
||||
Reference in New Issue
Block a user