]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks: fix cephadm config image check 35927/head
authorGeorgios Kyratsas <gkyratsas@suse.com>
Fri, 3 Jul 2020 14:01:54 +0000 (16:01 +0200)
committerGeorgios Kyratsas <gkyratsas@suse.com>
Thu, 9 Jul 2020 08:28:49 +0000 (10:28 +0200)
Check container_image_name only if ceph cluster image is not pre-defined in config.
We shouldn't care about container_image_name if there cephadm or ceph already have image defined.

Signed-off-by: Georgios Kyratsas <gkyratsas@suse.com>
qa/tasks/cephadm.py

index cb873aaccc4bdc0d28fcea0dedc1ecc35a6a2985..34b445133c0e2fc2a7fddcd53d0866a84fc0f05e 100644 (file)
@@ -1144,17 +1144,17 @@ def task(ctx, config):
     container_registry_mirror = mirrors.get('docker.io',
                                             container_registry_mirror)
 
-    if not container_image_name:
-        raise Exception("Configuration error occurred. "
-                        "The 'image' value is undefined for 'cephadm' task. "
-                        "Please provide corresponding options in the task's "
-                        "config, task 'overrides', or teuthology 'defaults' "
-                        "section.")
 
     if not hasattr(ctx.ceph[cluster_name], 'image'):
         ctx.ceph[cluster_name].image = config.get('image')
     ref = None
     if not ctx.ceph[cluster_name].image:
+        if not container_image_name:
+            raise Exception("Configuration error occurred. "
+                            "The 'image' value is undefined for 'cephadm' task. "
+                            "Please provide corresponding options in the task's "
+                            "config, task 'overrides', or teuthology 'defaults' "
+                            "section.")
         sha1 = config.get('sha1')
         if sha1:
             ctx.ceph[cluster_name].image = container_image_name + ':' + sha1