[logging]: DEBUG: ${__target_host}: return_output is True, ignoring stdout #60

Closed
opened 2021-11-20 11:25:19 +00:00 by ungleich-gitea · 8 comments

When running cdist -vvv, numerous messages like this appear; I identified that most of them come from explorers, which would be an expected situation.

Since these lines are so numerous and mostly superfluous, they difficult debugging when it is needed.

I would be tempted to open a MR removing this warning, but since I might be missing something:
Is logging this situation really needed? If so:

  • What is the rationale?
  • Would it be desirable to mute it somehow for explorers? An idea would be to add an optional flag to cdist.exec.remote.Remote.(run_script|run|_run_command) that identifies the run as coming from an explorer and not produce this debug message.
    (would open a PR implementing this running_explorer flag if deemed appropriate)

These are the lines with the message:
https://code.ungleich.ch/ungleich-public/cdist/blob/master/cdist/exec/remote.py#L283

When running `cdist -vvv`, numerous messages like this appear; I identified that most of them come from explorers, which would be an expected situation. Since these lines are so numerous and mostly superfluous, they difficult debugging when it is needed. I would be tempted to open a MR removing this warning, but since I might be missing something: Is logging this situation really needed? If so: - What is the rationale? - Would it be desirable to mute it *somehow* for explorers? An idea would be to add an optional flag to `cdist.exec.remote.Remote.(run_script|run|_run_command)` that identifies the run as coming from an explorer and not produce this debug message. (would open a PR implementing this `running_explorer` flag if deemed appropriate) These are the lines with the message: https://code.ungleich.ch/ungleich-public/cdist/blob/master/cdist/exec/remote.py#L283
Author
Owner

mentioned in commit 888cf54d99

mentioned in commit 888cf54d99c2dda1d399e4851ee84ef272dc64c7
Author
Owner

closed via commit 888cf54d99

closed via commit 888cf54d99c2dda1d399e4851ee84ef272dc64c7
Author
Owner

closed via merge request !872

closed via merge request !872
Author
Owner

closed via commit ea3bd14d8b

closed via commit ea3bd14d8b377818a16578bd5032a853188baeec
Author
Owner

mentioned in merge request !872

mentioned in merge request !872
Author
Owner

mentioned in merge request !871

mentioned in merge request !871
Author
Owner

Just checked the code and I am a bit confused: we have return_output and depending on PIPE. Best thing is though that I can use git blame to blame @poljakowski for it:

9703e0f08 cdist/exec/remote.py     (Darko Poljak     2018-01-09 09:31:40 +0100 283)         if return_output and stdout is not subprocess.PIPE:
9703e0f08 cdist/exec/remote.py     (Darko Poljak     2018-01-09 09:31:40 +0100 284)             self.log.debug("return_output is True, ignoring stdout")
Just checked the code and I am a bit confused: we have `return_output` and depending on PIPE. Best thing is though that I can use `git blame` to blame @poljakowski for it: ``` 9703e0f08 cdist/exec/remote.py (Darko Poljak 2018-01-09 09:31:40 +0100 283) if return_output and stdout is not subprocess.PIPE: 9703e0f08 cdist/exec/remote.py (Darko Poljak 2018-01-09 09:31:40 +0100 284) self.log.debug("return_output is True, ignoring stdout") ```
Author
Owner
  • rationale: side effect
  • desirable to mute: yes
  • support for creating mr to support scripts that don't output stdout: yes
* rationale: side effect * desirable to mute: yes * support for creating mr to support scripts that don't output stdout: yes
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ungleich-public/cdist#60
No description provided.