]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commit
windows: fix log collection 2113/head
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 15 Feb 2023 14:41:26 +0000 (16:41 +0200)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 15 Feb 2023 14:56:53 +0000 (16:56 +0200)
commit3e31b283b5338ae285319c1fa1fcdb9ed00352e5
tree3aacec5f6bce505e053fdc69026474584f3aafd5
parent9f188e9581eeafdb2233a7031ec07709f3ab39c4
windows: fix log collection

The "Get-WinEvent" command used to retrieve Windows event log
messages can fail if the specified log has no entries.

We're using the "SilentlyContinue" action to avoid erroring out
in such cases.

However, the script still terminates abruptly while collecting
logs. For this reason, we'll use the "Ignore" error action instead.
We'd rather not have test failures just because we failed to
retrieve some Windows event log entries.

Unlike "SilentlyContinue", "Ignore" doesn't populate the global
$Error variable, which may be used when running the script
remotely.

While at it, we're adding some log messages at the end of the
"run_tests" and "collect-event-logs.ps1" scripts.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
scripts/ceph-windows/collect-event-logs.ps1
scripts/ceph-windows/run_tests