siemens / kas

Setup tool for bitbake based projects
MIT License
339 stars 145 forks source link

libkas ssh_cleanup_agent() function could be less noisy #108

Closed JosephMillsAtWork closed 4 months ago

JosephMillsAtWork commented 5 months ago

Example:

Say I have set the SSH_PRIVATE_KEY or SSH_PRIVATE_KEY_FILE in the env for an CI. In my CI, I would like to gather information from bitbake. Or maybe I want to dump the output from kas dump to a file.

eval $(kas shell /some/yaml.yml -c "bitbake -e | grep ^DISTRO")
echo "${FOO}"

expected output

poky

received output

poky 
unset SSH_AUTH_SOCK;
unset SSH_AGENT_PID;
echo Agent pid .....
kas dump --resolv-ref --resolv-env /some/yaml.yml > /tmp/file.txt

This will also have the unset parts in it at the top.

proposed change is to add stdout=DEVNULL in libkas.py->ssh_cleanup_agent.

Thanks for your time.

JosephMillsAtWork commented 5 months ago

Patchfile.

quiet-ssh-cleanup-agent.txt

After testing the above patch , sadly it is still not working. Moving over to subprocess.DEVNULL seemed to do the trick. Attached is a patch. quiet-downnow-process.txt

jan-kiszka commented 5 months ago

Thanks for reporting and working on this! Just please have a look at https://github.com/siemens/kas/blob/master/CONTRIBUTING.md as well in order to get your patch into the final shape in the right channel.

fmoessbauer commented 5 months ago

@JosephMillsAtWork Please have a look at this patch. That should also fix the issue you reported. If you like to get a Reported-by:, please just answer on that mail and add the Reported-by: line.

fmoessbauer commented 4 months ago

Fixed in dbd32b047606c121a48a023eb29b6d1b75c61d04