fixed output logging (#2244)

Co-authored-by: Leo <ifuryst@gmail.com>
This commit is contained in:
மனோஜ்குமார் பழனிச்சாமி
2024-06-04 21:35:23 +05:30
committed by GitHub
parent 6dd6e6c087
commit 2ffd54d258

View File

@@ -52,14 +52,17 @@ class PluginMixin:
)
exit_code, output = self.execute(abs_path_to_bash_script, stream=True)
if isinstance(output, CancellableStream):
total_output = ''
for line in output:
if line.endswith('\n'):
line = line[:-1]
logger.debug(line)
total_output += line
_exit_code = output.exit_code()
output.close()
if _exit_code != 0:
raise RuntimeError(
f'Failed to initialize plugin {requirement.name} with exit code {_exit_code} and output {output}'
f'Failed to initialize plugin {requirement.name} with exit code {_exit_code} and output {total_output}'
)
logger.info(f'Plugin {requirement.name} initialized successfully')
else: