if i.lower() == attrName:
attrName = i
break
- if attrName in ArbChanges:
+ if attrName not in ArbChanges:
return None
- if re.match(ArbChanges[attrName], G[1]) is None:
+ value = G[1]
+ if re.match(ArbChanges[attrName], value) is None:
raise UDFormatError("Item does not match the required format" + ArbChanges[attrName])
Attrs.append((ldap.MOD_REPLACE, attrName, value))
if p == "":
if seenEmptypart:
return "Invalid IPv6 address (%s): more than one :: (nothing in between colons) is not allowed" % (ipv6address)
- seenEmptypart = True
+ seenEmptypart = True
sanitized = "%s IN AAAA %s" % (hostname, ipv6address)
else:
raise UDFormatError("None of the types I recognize was it. I shouldn't be here. confused.")
res = lc.search_s(BaseDn, ldap.SCOPE_ONELEVEL, "uid=" + uid, ['sudoPassword'])
if len(res) != 1:
raise UDFormatError("Not exactly one hit when searching for user")
- if sudoPassword in res[0][1]:
+ if 'sudoPassword' in res[0][1]:
inldap = res[0][1]['sudoPassword']
else:
inldap = []