Skip to content

Commit

Permalink
[oar/module/greta] clean logs and print executor cmd output
Browse files Browse the repository at this point in the history
  • Loading branch information
adfaure committed Nov 29, 2023
1 parent 15f5591 commit ebdf7bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 2 additions & 7 deletions oar/modules/almighty.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,11 @@ def check_greta(greta, logger):
res = tools.check_process(greta.pid, logger)

try:
stdout, stderr = greta.communicate(timeout=0)
logger.info(f"greta communicated: {stdout}\n{stderr}")
greta.communicate(timeout=0)
except Exception as e:
logger.info(f"greta exception: {e}")
logger.debug(f"{vars(e)}")
pass

# stdout, stderr = greta.communicate(timeout=0)
# logger.info(f"greta: {stdout}\n{stderr}")

logger.info(f"res: {res}")
return res


Expand Down
8 changes: 6 additions & 2 deletions oar/modules/greta.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,12 @@ def command_executor(cmd_node, config, logger):
logger.error("ENERGY_SAVING_NODE_MANAGER_WAKE_UP_CMD is undefined")
command_to_exec += config["ENERGY_SAVING_NODE_MANAGER_WAKE_UP_CMD"]

exit_code = tools.call(command_to_exec, shell=True)
return exit_code
logger.debug(f"Start executor command: {command_to_exec}")
result = tools.run(command_to_exec, shell=True, capture_output=True)

logger.debug(f"called: {result}")

return result.returncode


class WindowForker(object):
Expand Down

0 comments on commit ebdf7bb

Please sign in to comment.