diff --git a/jarvis_util/shell/exec_info.py b/jarvis_util/shell/exec_info.py index 94108fd..4c68e34 100644 --- a/jarvis_util/shell/exec_info.py +++ b/jarvis_util/shell/exec_info.py @@ -82,7 +82,7 @@ def __init__(self, exec_type=ExecType.LOCAL, nprocs=None, ppn=None, self.exec_async = exec_async self.stdin = stdin self.keys = ['exec_type', 'nprocs', 'ppn', 'user', 'pkey', 'port', - 'hostfile', 'env', 'sleep_ms', 'sudo', + 'hostfile', 'env', 'sleep_ms', 'sudo', 'sudoenv', 'cwd', 'hosts', 'collect_output', 'pipe_stdout', 'pipe_stderr', 'hide_output', 'exec_async', 'stdin'] diff --git a/jarvis_util/shell/ssh_exec.py b/jarvis_util/shell/ssh_exec.py index e207971..36e6ec3 100644 --- a/jarvis_util/shell/ssh_exec.py +++ b/jarvis_util/shell/ssh_exec.py @@ -29,9 +29,10 @@ def __init__(self, cmd, exec_info): cmd = self.smash_cmd(cmd, self.sudo, self.basic_env, exec_info.sudoenv) if not exec_info.hostfile.is_local(): super().__init__(self.ssh_cmd(cmd), - exec_info.mod(env=exec_info.basic_env)) + exec_info.mod(env=exec_info.basic_env, + sudo=False)) else: - super().__init__(cmd, exec_info) + super().__init__(cmd, exec_info.mod(sudo=False)) def ssh_cmd(self, cmd): lines = ['ssh'] diff --git a/jarvis_util/util/import_mod.py b/jarvis_util/util/import_mod.py index 3104c27..d752205 100644 --- a/jarvis_util/util/import_mod.py +++ b/jarvis_util/util/import_mod.py @@ -24,7 +24,10 @@ def load_class(import_str, path, class_name): """ if len(path): sys.path.insert(0, path) - module = __import__(import_str, fromlist=[class_name]) + try: + module = __import__(import_str, fromlist=[class_name]) + except: + return None if len(path): sys.path.pop(0) return getattr(module, class_name)