]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Don't run apache functions if not using apache
authorZack Cerza <zack@cerza.org>
Tue, 15 Apr 2014 22:02:33 +0000 (17:02 -0500)
committerZack Cerza <zack@cerza.org>
Wed, 16 Apr 2014 14:45:07 +0000 (09:45 -0500)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/task/rgw.py

index 1f1058eef77d0bedbaa7a85ed398306b9bc194dd..ebff51a4e7e5dd7f6077ddcc084664d1e3794fa9 100644 (file)
@@ -764,24 +764,45 @@ def task(ctx, config):
         del config['frontend']
     log.info("Using %s as radosgw frontend", ctx.rgw.frontend)
 
-    with contextutil.nested(
-        lambda: create_apache_dirs(ctx=ctx, config=config),
-        lambda: configure_regions_and_zones(
-            ctx=ctx,
-            config=config,
-            regions=regions,
-            role_endpoints=role_endpoints,
-            ),
-        lambda: configure_users(
-            ctx=ctx,
-            config=config,
-            everywhere=bool(regions),
-            ),
-        lambda: create_nonregion_pools(
-            ctx=ctx, config=config, regions=regions),
-        lambda: ship_apache_configs(ctx=ctx, config=config,
-                                    role_endpoints=role_endpoints),
-        lambda: start_rgw(ctx=ctx, config=config),
-        lambda: start_apache(ctx=ctx, config=config),
-            ):
-        yield
+    if ctx.rgw.frontend == 'apache':
+        with contextutil.nested(
+            lambda: create_apache_dirs(ctx=ctx, config=config),
+            lambda: configure_regions_and_zones(
+                ctx=ctx,
+                config=config,
+                regions=regions,
+                role_endpoints=role_endpoints,
+                ),
+            lambda: configure_users(
+                ctx=ctx,
+                config=config,
+                everywhere=bool(regions),
+                ),
+            lambda: create_nonregion_pools(
+                ctx=ctx, config=config, regions=regions),
+            lambda: ship_apache_configs(ctx=ctx, config=config,
+                                        role_endpoints=role_endpoints),
+            lambda: start_rgw(ctx=ctx, config=config),
+            lambda: start_apache(ctx=ctx, config=config),
+                ):
+            yield
+    elif ctx.rgw.frontend == 'civetweb':
+        with contextutil.nested(
+            lambda: configure_regions_and_zones(
+                ctx=ctx,
+                config=config,
+                regions=regions,
+                role_endpoints=role_endpoints,
+                ),
+            lambda: configure_users(
+                ctx=ctx,
+                config=config,
+                everywhere=bool(regions),
+                ),
+            lambda: create_nonregion_pools(
+                ctx=ctx, config=config, regions=regions),
+            lambda: start_rgw(ctx=ctx, config=config),
+                ):
+            yield
+    else:
+        raise ValueError("frontend must be 'apache' or 'civetweb'")