mirror of https://github.com/ceph/ceph-ansible.git
tests: if no osds are created do not error in conftest.py
If no OSDs were created the command would fail and because we were using check_output it would throw an exception and mark all OSD tests as ERROR. This keeps tests from running that might tell us why the OSDS were not created. Signed-off-by: Andrew Schoen <aschoen@redhat.com>pull/1276/head
parent
064c57babb
commit
d02f14a329
|
@ -27,17 +27,6 @@ def node(Ansible, Interface, Command, request):
|
||||||
osd_ids = []
|
osd_ids = []
|
||||||
osds = []
|
osds = []
|
||||||
cluster_address = ""
|
cluster_address = ""
|
||||||
if node_type == "osds":
|
|
||||||
result = Command.check_output('sudo ls /var/lib/ceph/osd/ | grep -oP "\d+$"')
|
|
||||||
osd_ids = result.split("\n")
|
|
||||||
# I can assume eth2 because I know all the vagrant
|
|
||||||
# boxes we test with use that interface. OSDs are the only
|
|
||||||
# nodes that have this interface.
|
|
||||||
cluster_address = Interface("eth2").addresses[0]
|
|
||||||
osds = osd_ids
|
|
||||||
if docker:
|
|
||||||
osds = [device.split("/")[-1] for device in ansible_vars["devices"]]
|
|
||||||
|
|
||||||
# I can assume eth1 because I know all the vagrant
|
# I can assume eth1 because I know all the vagrant
|
||||||
# boxes we test with use that interface
|
# boxes we test with use that interface
|
||||||
address = Interface("eth1").addresses[0]
|
address = Interface("eth1").addresses[0]
|
||||||
|
@ -48,6 +37,18 @@ def node(Ansible, Interface, Command, request):
|
||||||
total_osds = num_devices * num_osd_hosts
|
total_osds = num_devices * num_osd_hosts
|
||||||
cluster_name = ansible_vars.get("cluster", "ceph")
|
cluster_name = ansible_vars.get("cluster", "ceph")
|
||||||
conf_path = "/etc/ceph/{}.conf".format(cluster_name)
|
conf_path = "/etc/ceph/{}.conf".format(cluster_name)
|
||||||
|
if node_type == "osds":
|
||||||
|
# I can assume eth2 because I know all the vagrant
|
||||||
|
# boxes we test with use that interface. OSDs are the only
|
||||||
|
# nodes that have this interface.
|
||||||
|
cluster_address = Interface("eth2").addresses[0]
|
||||||
|
cmd = Command('sudo ls /var/lib/ceph/osd/ | grep -oP "\d+$"')
|
||||||
|
if cmd.rc == 0:
|
||||||
|
osd_ids = cmd.stdout.rstrip("\n").split("\n")
|
||||||
|
osds = osd_ids
|
||||||
|
if docker:
|
||||||
|
osds = [device.split("/")[-1] for device in ansible_vars["devices"]]
|
||||||
|
|
||||||
data = dict(
|
data = dict(
|
||||||
address=address,
|
address=address,
|
||||||
subnet=subnet,
|
subnet=subnet,
|
||||||
|
|
Loading…
Reference in New Issue