Skip to content

Commit 330120c

Browse files
committed
Rename m_ arguments to _attrs in gssapi/mechs.py
Signed-off-by: Alexander Scheel <ascheel@redhat.com>
1 parent 4a2736e commit 330120c

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

gssapi/mechs.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,16 @@ def from_sasl_name(cls, name=None):
164164
return cls(m)
165165

166166
@classmethod
167-
def from_attrs(cls, m_desired=None, m_except=None, m_critical=None):
167+
def from_attrs(cls, desired_attrs=None, except_attrs=None,
168+
critical_attrs=None):
168169
"""
169170
Get a generator of mechanisms supporting the specified attributes. See
170171
RFC 5587's :func:`indicate_mechs_by_attrs` for more information.
171172
172173
Args:
173-
m_desired ([OID]): Desired attributes
174-
m_except ([OID]): Except attributes
175-
m_critical ([OID]): Critical attributes
174+
desired_attrs ([OID]): Desired attributes
175+
except_attrs ([OID]): Except attributes
176+
critical_attrs ([OID]): Critical attributes
176177
177178
Returns:
178179
[Mechanism]: A set of mechanisms having the desired features.
@@ -182,18 +183,18 @@ def from_attrs(cls, m_desired=None, m_except=None, m_critical=None):
182183
183184
:requires-ext:`rfc5587`
184185
"""
185-
if isinstance(m_desired, roids.OID):
186-
m_desired = set([m_desired])
187-
if isinstance(m_except, roids.OID):
188-
m_except = set([m_except])
189-
if isinstance(m_critical, roids.OID):
190-
m_critical = set([m_critical])
186+
if isinstance(desired_attrs, roids.OID):
187+
desired_attrs = set([desired_attrs])
188+
if isinstance(except_attrs, roids.OID):
189+
except_attrs = set([except_attrs])
190+
if isinstance(critical_attrs, roids.OID):
191+
critical_attrs = set([critical_attrs])
191192

192193
if rfc5587 is None:
193194
raise NotImplementedError("Your GSSAPI implementation does not "
194195
"have support for RFC 5587")
195196

196-
mechs = rfc5587.indicate_mechs_by_attrs(m_desired,
197-
m_except,
198-
m_critical)
197+
mechs = rfc5587.indicate_mechs_by_attrs(desired_attrs,
198+
except_attrs,
199+
critical_attrs)
199200
return (cls(mech) for mech in mechs)

gssapi/tests/test_high_level.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,16 @@ def test_sasl_properties(self):
400400
def test_mech_inquiry(self):
401401
mechs = list(gssmechs.Mechanism.all_mechs())
402402
c = len(mechs)
403+
404+
g_M_from_attrs = gssmechs.Mechanism.from_attrs
405+
403406
for mech in mechs:
404407
attrs = mech.attrs
405408
known_attrs = mech.known_attrs
406409

407410
for attr in attrs:
408-
from_desired = gssmechs.Mechanism.from_attrs(m_desired=[attr])
409-
from_except = gssmechs.Mechanism.from_attrs(m_except=[attr])
411+
from_desired = g_M_from_attrs(desired_attrs=[attr])
412+
from_except = g_M_from_attrs(except_attrs=[attr])
410413

411414
from_desired = list(from_desired)
412415
from_except = list(from_except)
@@ -416,8 +419,8 @@ def test_mech_inquiry(self):
416419
from_except.shouldnt_include(mech)
417420

418421
for attr in known_attrs:
419-
from_desired = gssmechs.Mechanism.from_attrs(m_desired=[attr])
420-
from_except = gssmechs.Mechanism.from_attrs(m_except=[attr])
422+
from_desired = g_M_from_attrs(desired_attrs=[attr])
423+
from_except = g_M_from_attrs(except_attrs=[attr])
421424

422425
from_desired = list(from_desired)
423426
from_except = list(from_except)

0 commit comments

Comments
 (0)