Closed webknjaz closed 1 year ago
@samdoran looks like your implementation diverged from my initial suggestion at https://github.com/samdoran/ansible-collection-macos/pull/3#issuecomment-1176695266 and this specific check might've never worked.
In my implementation, I was relying on the return code, and you've gone for checking the stderr
.
But when using the raw
module, it seems like everything returned by the command being executed ends up in stdout
, not stderr
. And stderr
contains whatever the underlying SSH client logs.
I'll let @mattclay correct me, but it appears like this check never worked as intended in the first place.
Relying on the output of raw to be in only one of stderr or stdout is fragile, as it can change depending on the connection plugin and options used. I'd either use the return code or combine the output from stderr and stdout and check that instead.
Relying on the output of raw to be in only one of stderr or stdout is fragile, as it can change depending on the connection plugin and options used
Oh, that's a good point. I just made a minor change the bootstrap playbook and was confused about the stderr vs stdout behavior.
I forget why exactly I was checking for specific strings. I think checking the return code is probably the best solution.
@samdoran will you be releasing these recent changes soon? I don't know when #8 will be ready, so no need to wait for it.
I can make a release whenever. I wasn't sure if we wanted to wait for other changes.
I suppose making another release when that PR is in is also an option. I'm working on multiple things which is why the timing is unpredictable. But it seems like a good idea to release bug fixes right away if the process isn't too involved. If it's a burden, I can build an automation that would allow you to have a single-click workflow for making new releases, if you want.
Version 2.2.3 is published.
For some reason, the check for the presence of Xcode CLI tools is misbehaving, causing the installation to be skipped, followed by a failing check for the python3 install that fails and opens a window asking for the Xcode CLI tools install. Logging this here for now. It appears that the SSH output somehow leaks into the task results, causing this. The string that the check is expecting is present in the stdout value, though, not stderr.