Browse Source

Swap the order of username deprecation

The deprecation of username in favor of user-name has been reverted in
python-keystoneclient in [1], we should keep this in sync here.

This is a cherry-pick of [2], the patch from [1] has been backported to
stable/liberty in [3], so we should aim to be consistent here.

[1] https://review.openstack.org/247574
[2] https://review.openstack.org/287754
[3] https://review.openstack.org/269364

Change-Id: Ia82536ecebfc5874add36f6fbc349d9a9cbf3a08
Jens Rosenboom 3 years ago
parent
commit
aa122e73cc

+ 2
- 3
keystoneauth1/loading/_plugins/identity/generic.py View File

@@ -64,10 +64,9 @@ class Password(GenericBaseLoader):
64 64
         options = super(Password, cls).get_options()
65 65
         options.extend([
66 66
             loading.Opt('user-id', help='User id'),
67
-            loading.Opt('user-name',
68
-                        dest='username',
67
+            loading.Opt('username',
69 68
                         help='Username',
70
-                        deprecated=[loading.Opt('username')]),
69
+                        deprecated=[loading.Opt('user-name')]),
71 70
             loading.Opt('user-domain-id', help="User's domain id"),
72 71
             loading.Opt('user-domain-name', help="User's domain name"),
73 72
             loading.Opt('password', secret=True, help="User's password"),

+ 3
- 4
keystoneauth1/loading/_plugins/identity/v2.py View File

@@ -55,11 +55,10 @@ class Password(BaseV2Loader):
55 55
         options = super(Password, self).get_options()
56 56
 
57 57
         options.extend([
58
-            loading.Opt('user-name',
59
-                       dest='username',
60
-                       deprecated=[loading.Opt('username')],
58
+            loading.Opt('username',
59
+                       deprecated=[loading.Opt('user-name')],
61 60
                        help='Username to login with'),
62
-            loading.Opt('user-id', help='User ID to longin with'),
61
+            loading.Opt('user-id', help='User ID to login with'),
63 62
             loading.Opt('password', secret=True, help='Password to use'),
64 63
         ])
65 64
 

+ 2
- 3
keystoneauth1/loading/_plugins/identity/v3.py View File

@@ -59,10 +59,9 @@ class Password(BaseV3Loader):
59 59
 
60 60
         options.extend([
61 61
             loading.Opt('user-id', help='User ID'),
62
-            loading.Opt('user-name',
63
-                        dest='username',
62
+            loading.Opt('username',
64 63
                         help='Username',
65
-                        deprecated=[loading.Opt('username')]),
64
+                        deprecated=[loading.Opt('user-name')]),
66 65
             loading.Opt('user-domain-id', help="User's domain id"),
67 66
             loading.Opt('user-domain-name', help="User's domain name"),
68 67
             loading.Opt('password', secret=True, help="User's password"),

+ 1
- 1
keystoneauth1/tests/unit/loading/test_generic.py View File

@@ -19,7 +19,7 @@ class PasswordTests(utils.TestCase):
19 19
     def test_options(self):
20 20
         opts = [o.name for o in generic.Password().get_options()]
21 21
 
22
-        allowed_opts = ['user-name',
22
+        allowed_opts = ['username',
23 23
                         'user-domain-id',
24 24
                         'user-domain-name',
25 25
                         'user-id',

Loading…
Cancel
Save