Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect odoobin output #52

Merged
merged 2 commits into from
May 20, 2019
Merged

Redirect odoobin output #52

merged 2 commits into from
May 20, 2019

Conversation

raneq
Copy link
Collaborator

@raneq raneq commented May 17, 2019

Right now, if the command fails, Ansible gets nothing in output terms (neither err), and this is bad to debug. We need to go find the log inside the host at /etc/odoo/odoo.log, but this is mixed with other log entries. A perfect approach would feed both stdout and default log

For instance, if for some reason update odoo modules fails, we get:

fatal: [odoo.coopdevs.org]: FAILED! => 
{
   "start" : "2019-05-17 11:45:13.626822",
   "delta" : "0:01:04.866362",
   "stdout" : "",
   "stdout_lines" : [],
   "changed" : true,
   "msg" : "non-zero return code",
   "cmd" : [
      "/opt/.odoo_venv/bin/python",
      "/opt/odoo/odoo-bin",
      "-c",
      "/etc/odoo/odoo.conf",
      "-d",
      "odoo",
      "--update",
      "all",
      "--stop-after-init",
      "--without-demo=all"
   ],
   "end" : "2019-05-17 11:46:18.493184",
   "stderr" : "",
   "rc" : 255,
   "stderr_lines" : []
}

So we get nothing else useful than the exact command and time executed, and the error code (rc).

With the modifications I propose, stdout / stderr will contain warning and error messages.

raneq added 2 commits May 17, 2019 20:29
don't redirect just in one command, we want a single commit redirecting all of them together
Right now, if the command fails, Ansible gets nothing in output terms (neither err), and this is bad to debug. We need to go find the log inside the host at /etc/odoo/odoo.log, but this is mixed with other log entries. A perfect approach would feed both stdout and default log
@raneq raneq requested review from danypr92 and enricostano May 17, 2019 18:41
@raneq raneq merged commit f70a253 into master May 20, 2019
@raneq raneq deleted the redirect-odoobin-output branch June 3, 2019 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants