[BUG] 1.6.0-daily - Agent Bakery - Deploy custom files on Windows: wrong bin path

Hello,
I think I have found a small bug in the bakery (1.6.0-2020.11.12.cee) when a custom script should be deployed into bin on a windows host.

There is one custom package defined:

OMD[cmk]:~/local/share/check_mk/agents/custom$ tree
.
`-- robotmk-plugin
    `-- bin
        `-- robotmk.py

It is shown and activated in the rule I am configuring for a Windows host:

image

After baking and installing the agent, the script is not placed in the bin folder, but inside the agent folder:

image

I have debugged the agent_bakery.py script and have found that in case of Windows the middle_path is empty; it should be bin:

image

This is how the middle_path gets set correctly on my side:

image

image

Probably not the best and final solution… perhaps someone from tribe29 can have a look on this.
Thanks,
Simon

The Windows agent does not have a standard bin directory. Maybe that’s why it is not used.

When deploying custom files to a Linux agent files in a bin subdirectory land in /usr/bin.

I think @simonm’s argument is valid and i would also title this as a agent bakery bug.
If @SergejKipnis can have a look it would also help if this not also happens in 2.0 :slight_smile:
As the code is complete different in 2.0 agent_bakery.py and i had no time to test, i don’t know if the same problem exists there.

Just to play safe, can anybody reproduce this behaviour?

@r.sander I have just done again a Vanilla agent installation, it contains a bin directory on my VM:
image

Regards,
SImon

Oh, I stand corrected.