Skip to content

Commit f076b55

Browse files
committed
Bail out if configuration.site_user_id_format is invalid in get_any_oid_user_dn
to make lint happy. Not a new issue but makes sense and adds consistence with other functions using it.
1 parent a8ee7fb commit f076b55

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mig/shared/useradm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,6 +1829,9 @@ def get_any_oid_user_dn(configuration, raw_login,
18291829
distinguished_name = lookup_client_id(configuration, user_id)
18301830
elif configuration.site_user_id_format == X509_USER_ID_FORMAT:
18311831
distinguished_name = client_dir_id(native_dir)
1832+
else:
1833+
raise ValueError("invalid user ID format requested: %s" %
1834+
configuration.site_user_id_format)
18321835
_logger.debug('found full ID %s from %s link'
18331836
% (distinguished_name, raw_login))
18341837
return distinguished_name

0 commit comments

Comments
 (0)