Browse Source

Fix default mutable arg in k2k.py

Change-Id: I9e8d838315d521874e6f92922a9f488ee7029dbc
Rob Cresswell 1 year ago
parent
commit
a0af708a49
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      openstack_auth/plugin/k2k.py

+ 4
- 1
openstack_auth/plugin/k2k.py View File

@@ -28,7 +28,7 @@ __all__ = ['K2KAuthPlugin']
28 28
 
29 29
 class K2KAuthPlugin(base.BasePlugin):
30 30
 
31
-    def get_plugin(self, service_provider=None, auth_url=None, plugins=[],
31
+    def get_plugin(self, service_provider=None, auth_url=None, plugins=None,
32 32
                    **kwargs):
33 33
         """Authenticate using keystone to keystone federation.
34 34
 
@@ -42,6 +42,9 @@ class K2KAuthPlugin(base.BasePlugin):
42 42
         :returns Keystone2Keystone keystone auth plugin
43 43
         """
44 44
 
45
+        # Avoid mutable default arg for plugins
46
+        plugins = plugins or []
47
+
45 48
         # service_provider being None prevents infinite recursion
46 49
         if utils.get_keystone_version() < 3 or not service_provider:
47 50
             return None

Loading…
Cancel
Save