mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #7697/a5cd4ebe backport][stable-7] Simplify regex for identifying order number in DN (#7646) (#7913)
Simplify regex for identifying order number in DN (#7646) (#7697)
Assume that if a string of digits occurs between curly braces anywhere
in the first component of the DN, that this is an order number. The
sequence does not necessarily have to occur after an equals sign.
(cherry picked from commit a5cd4ebea2
)
Co-authored-by: Aaron Sowry <aeneby@users.noreply.github.com>
This commit is contained in:
parent
62613427af
commit
2f04bd32d0
2 changed files with 6 additions and 2 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- ldap - previously the order number (if present) was expected to follow an equals sign in the DN. This makes it so the order number string is identified correctly anywhere within the DN (https://github.com/ansible-collections/community.general/issues/7646).
|
|
@ -139,5 +139,7 @@ class LdapGeneric(object):
|
||||||
|
|
||||||
def _xorder_dn(self):
|
def _xorder_dn(self):
|
||||||
# match X_ORDERed DNs
|
# match X_ORDERed DNs
|
||||||
regex = r"\w+=\{\d+\}.+"
|
regex = r".+\{\d+\}.+"
|
||||||
return re.match(regex, self.module.params['dn']) is not None
|
explode_dn = ldap.dn.explode_dn(self.module.params['dn'])
|
||||||
|
|
||||||
|
return re.match(regex, explode_dn[0]) is not None
|
||||||
|
|
Loading…
Reference in a new issue