Skip to content

Commit

Permalink
Update cisco.py
Browse files Browse the repository at this point in the history
  • Loading branch information
u-n-i-c-o-rn authored Aug 24, 2021
1 parent d0451ca commit 54686de
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions includes/cisco.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ def connect(self,username,password,port):
client.connect(self.host, username=username, password=password, port=port, look_for_keys=True, timeout=self.timeout,banner_timeout=200)
self.channel = client.invoke_shell()
if not self.recv():
self.command("")
time.sleep(0.5)
startTime = time.time()
detectedDevice = ""
while ( time.time() - startTime < 5 ):
self.command("")
if self.channel.recv_ready():
detectedDevice = self.channel.recv(2048).decode().strip()
time.sleep(0.1)
detectedDevice += self.channel.recv(2048).decode().strip()
time.sleep(0.5)
self.error = f"Device detected name does not match the device name provided. Hostname found = {detectedDevice}"
client.close()
return None
Expand Down

0 comments on commit 54686de

Please sign in to comment.