Fixed issues
This commit is contained in:
@ -73,12 +73,17 @@ def main():
|
|||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
exec(f"from remotesyn.toolchains.{toolchain} import do")
|
print(f'Importing toolchain {toolchain}')
|
||||||
|
namespace = {}
|
||||||
|
exec(f"from remotesyn.toolchains.{toolchain} import do", globals(), namespace)
|
||||||
|
do_func = namespace.get('do')
|
||||||
|
if do_func is None:
|
||||||
|
raise ImportError("Failed to import 'do'")
|
||||||
except ImportError:
|
except ImportError:
|
||||||
log(f"ERROR: Unknown toolchain '{toolchain}'")
|
log(f"ERROR: Unknown toolchain '{toolchain}'")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
ret = do(config, target, log, subprocesses)
|
ret = do_func(config, target, log, subprocesses)
|
||||||
|
|
||||||
if ret!=0:
|
if ret!=0:
|
||||||
log("ERROR: toolchain returned with", ret)
|
log("ERROR: toolchain returned with", ret)
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import threading
|
|||||||
import socket
|
import socket
|
||||||
import shutil
|
import shutil
|
||||||
import fcntl
|
import fcntl
|
||||||
|
import traceback
|
||||||
|
|
||||||
# List of running threads
|
# List of running threads
|
||||||
threads = []
|
threads = []
|
||||||
@ -209,6 +210,7 @@ class SSHServer(paramiko.ServerInterface):
|
|||||||
global running
|
global running
|
||||||
if running:
|
if running:
|
||||||
print("ERROR: Unknown error:", e)
|
print("ERROR: Unknown error:", e)
|
||||||
|
traceback.print_exception(type(e), e, e.__traceback__)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
class Connection(threading.Thread):
|
class Connection(threading.Thread):
|
||||||
@ -258,6 +260,8 @@ def print_help():
|
|||||||
print(" -h Show this help message")
|
print(" -h Show this help message")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
global running
|
||||||
|
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
i = 1
|
i = 1
|
||||||
host = ''
|
host = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user