]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: lvm_osds does not have devices defined
authorAndrew Schoen <aschoen@redhat.com>
Tue, 25 Jul 2017 19:37:25 +0000 (14:37 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Fri, 4 Aug 2017 11:13:09 +0000 (06:13 -0500)
This means that our tests needs to use the lvm_volumes dictionary
instead of devices.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
tests/conftest.py

index 0bcc992383e457c8fe57d7438177eebc9b5ab272..cc3b851a7da95a5ad2d38ffdcbc69face231e6c4 100644 (file)
@@ -43,7 +43,9 @@ def node(Ansible, Interface, Command, request):
     address = Interface("eth1").addresses[0]
     subnet = ".".join(ansible_vars["public_network"].split(".")[0:-1])
     num_mons = len(ansible_vars["groups"]["mons"])
-    num_devices = len(ansible_vars["devices"])
+    num_devices = len(ansible_vars.get("devices", []))
+    if not num_devices:
+        num_devices = len(ansible_vars.get("lvm_volumes", []))
     num_osd_hosts = len(ansible_vars["groups"]["osds"])
     total_osds = num_devices * num_osd_hosts
     cluster_name = ansible_vars.get("cluster", "ceph")
@@ -58,7 +60,7 @@ def node(Ansible, Interface, Command, request):
             osd_ids = cmd.stdout.rstrip("\n").split("\n")
             osds = osd_ids
             if docker:
-                osds = [device.split("/")[-1] for device in ansible_vars["devices"]]
+                osds = [device.split("/")[-1] for device in ansible_vars.get("devices", [])]
 
     data = dict(
         address=address,