]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commit
tests: fix `_get_osd_id_from_host()` in TestOSDs()
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 9 Jul 2018 09:51:24 +0000 (11:51 +0200)
committerSébastien Han <seb@redhat.com>
Wed, 11 Jul 2018 08:58:44 +0000 (10:58 +0200)
commit2e28879e0b8b32c0798206cd5b48eb08763e6690
tree48028801576172f178dd86174b2d2ba42d2d9024
parentfd93e5e8f01d261f7ee6a90f4ce4357ca7a38971
tests: fix `_get_osd_id_from_host()` in TestOSDs()

We must initialize `children` variable in `_get_osd_id_from_host()`,
otherwise, if for any reason the deployment has failed and result with
an osd host with no OSD registered, we won't enter in the condition,
therefore, `children` is never set and the function tries to return
something undefined.

Typical error:
```
E       UnboundLocalError: local variable 'children' referenced before assignment
```

Fixes: #2860
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 9a65ec231d7f76655caa964e1d9228ba7a910dea)
tests/functional/tests/osd/test_osds.py