Browse Source

Merge "Add warning log if auth_strategy is not keystone" into stable/stein

changes/49/675349/3
Zuul 1 week ago
parent
commit
5852b6f35c
2 changed files with 9 additions and 1 deletions
  1. 3
    1
      octavia/api/v2/controllers/load_balancer.py
  2. 6
    0
      octavia/cmd/api.py

+ 3
- 1
octavia/api/v2/controllers/load_balancer.py View File

@@ -324,7 +324,9 @@ class LoadBalancersController(base.BaseController):
324 324
 
325 325
         if not load_balancer.project_id:
326 326
             raise exceptions.ValidationException(detail=_(
327
-                "Missing project ID in request where one is required."))
327
+                "Missing project ID in request where one is required. "
328
+                "An administrator should check the keystone settings "
329
+                "in the Octavia configuration."))
328 330
 
329 331
         self._auth_validate_action(context, load_balancer.project_id,
330 332
                                    constants.RBAC_POST)

+ 6
- 0
octavia/cmd/api.py View File

@@ -20,6 +20,7 @@ from oslo_log import log as logging
20 20
 from oslo_reports import guru_meditation_report as gmr
21 21
 
22 22
 from octavia.api import app as api_app
23
+from octavia.common import constants
23 24
 from octavia import version
24 25
 
25 26
 
@@ -35,6 +36,11 @@ def main():
35 36
     port = cfg.CONF.api_settings.bind_port
36 37
     LOG.info("Starting API server on %(host)s:%(port)s",
37 38
              {"host": host, "port": port})
39
+    if cfg.CONF.api_settings.auth_strategy != constants.KEYSTONE:
40
+        LOG.warning('Octavia configuration [api_settings] auth_strategy is '
41
+                    'not set to "keystone". This is not a normal '
42
+                    'configuration and you may get "Missing project ID" '
43
+                    'errors from API calls."')
38 44
     srv = simple_server.make_server(host, port, app)
39 45
 
40 46
     srv.serve_forever()

Loading…
Cancel
Save