]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commit
ceph-ansible: fix teardown issue 1034/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 29 May 2018 12:36:52 +0000 (14:36 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 29 May 2018 12:56:11 +0000 (14:56 +0200)
commit1b6248977955d0a8425509e9c7d632dd1bb00561
tree99b81dfb283c8688d12c63eba16cfb5ff7c2c2fc
parent8ebf99028d28579b9998916484111cf516c7b55d
ceph-ansible: fix teardown issue

At the moment, the teardown isn't fully executed because of `collect-logs.yml`
playbook.

it is expected the following task can fail according to the context of the main
failure:

```
TASK [find ceph logs] **********************************************************
task path: /home/jenkins-build/build/workspace/ceph-ansible-scenario/collect-logs.yml:4
fatal: [ceph-nfs0]: FAILED! => {
    "changed": true,
    "cmd": [
        "find",
        "/var/log/ceph",
        "-name",
        "test*.log"
    ],
    "delta": "0:00:00.003363",
    "end": "2018-05-23 16:45:22.845782",
    "rc": 1,
    "start": "2018-05-23 16:45:22.842419"
}

STDERR:

find: ‘/var/log/ceph’: No such file or directory

MSG:

non-zero return code
```

therefore, `teardown_vagrant_tests()` doesn't return `0` and causes the
teardown to stop because of `set -e`

```
PLAY RECAP *********************************************************************
ceph-client0               : ok=1    changed=0    unreachable=0    failed=1
ceph-client1               : ok=1    changed=0    unreachable=0    failed=1
ceph-iscsi-gw0             : ok=1    changed=0    unreachable=0    failed=1
ceph-mds0                  : ok=1    changed=0    unreachable=0    failed=1
ceph-mgr0                  : ok=1    changed=0    unreachable=0    failed=1
ceph-mon0                  : ok=3    changed=2    unreachable=0    failed=0
ceph-mon1                  : ok=3    changed=2    unreachable=0    failed=0
ceph-mon2                  : ok=3    changed=2    unreachable=0    failed=0
ceph-nfs0                  : ok=1    changed=0    unreachable=0    failed=1
ceph-osd0                  : ok=1    changed=0    unreachable=0    failed=1
ceph-rbd-mirror0           : ok=1    changed=0    unreachable=0    failed=1
ceph-rgw0                  : ok=1    changed=0    unreachable=0    failed=1

Build step 'Execute Scripts' marked build as failure
Archiving artifacts
Finished: FAILURE
```

adding a `failed_when: false` on this task should avoid this bug.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
scripts/build_utils.sh