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

Multiple files tags #33

Open
bilboer opened this issue Oct 25, 2021 · 0 comments
Open

Multiple files tags #33

bilboer opened this issue Oct 25, 2021 · 0 comments

Comments

@bilboer
Copy link
Contributor

bilboer commented Oct 25, 2021

Implement a way to distinguish between multiple files generated by a single command report.

            hotsos-short:
              exit-codes: 0 2 127 126
              output-files:
                   short: *.short.summary$
                   long: *.long.summary$
              run: |
                #!/bin/bash
                git clone --quiet https://github.com/canonical/hotsos.git {{basedir}}/hotsos &>/dev/null
                tar -xf {{filepath}} -C {{basedir}} &>/dev/null
                {{basedir}}/hotsos/hotsos.sh -s --all-logs --short {{basedir}}/$(basename {{filepath}} .tar.xz)/ &>/dev/null
                if [ -s *.short.summary ]; then
                  cat *.short.summary
                else
                  echo "No known bugs or issues found on sosreport."
                fi
                rm -f *.short.summary
                exit 0

That you can later refer from the template as

        {%- for file, content in report.files %}
        {% endfor %}
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

No branches or pull requests

1 participant