better logic
All checks were successful
Deploy powerbar.ti Frontend Portal / Deploy-Tinance2-Frontend-Portal-Production (push) Successful in 7s
All checks were successful
Deploy powerbar.ti Frontend Portal / Deploy-Tinance2-Frontend-Portal-Production (push) Successful in 7s
This commit is contained in:
parent
00238b3033
commit
d649cbfb18
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,6 @@ from flask import jsonify
|
||||||
import telnetlib
|
import telnetlib
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
routes = Blueprint('routes', __name__)
|
routes = Blueprint('routes', __name__)
|
||||||
|
|
||||||
# Create a dictionary to store the active telnet connections
|
# Create a dictionary to store the active telnet connections
|
||||||
|
@ -32,6 +31,7 @@ def get_telnet_connection(powerbar):
|
||||||
|
|
||||||
def run_telnet_command(powerbar, command):
|
def run_telnet_command(powerbar, command):
|
||||||
try:
|
try:
|
||||||
|
tn = get_telnet_connection(powerbar)
|
||||||
tn.write(f"{command}\r\n".encode('ascii'))
|
tn.write(f"{command}\r\n".encode('ascii'))
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in a new issue