@@ -44,22 +44,22 @@ def list_service_users(service='nifi'):
44
44
45
45
def get_service_user (identifier , identifier_type = 'identity' , service = 'nifi' ):
46
46
"""
47
- Filters the all users list for a given identifier and type
47
+ Gets the unique user matching to the given identifier and type.
48
48
49
49
Args:
50
50
identifier (str): the string to search for
51
51
identifier_type (str): the field to search in
52
52
service (str): the name of the service
53
53
54
54
Returns:
55
- None if no match, list of multiple matches, else single object
55
+ None if no match, else single object
56
56
57
57
"""
58
58
assert service in _valid_services
59
59
assert isinstance (identifier , six .string_types )
60
60
assert isinstance (identifier_type , six .string_types )
61
61
obj = list_service_users (service )
62
- out = nipyapi .utils .filter_obj (obj , identifier , identifier_type )
62
+ out = nipyapi .utils .filter_obj (obj , identifier , identifier_type , greedy = False )
63
63
return out
64
64
65
65
@@ -212,22 +212,22 @@ def list_service_user_groups(service='nifi'):
212
212
def get_service_user_group (identifier , identifier_type = 'identity' ,
213
213
service = 'nifi' ):
214
214
"""
215
- Filters the all groups list for a given identifier and type
215
+ Gets the unique group matching to the given identifier and type.
216
216
217
217
Args:
218
218
identifier (str): the string to search for
219
219
identifier_type (str): the field to search in, identity or id
220
220
service (str): the name of the service
221
221
222
222
Returns:
223
- None if no match, list of multiple matches, else single object
223
+ None if no match, else single object
224
224
225
225
"""
226
226
assert service in _valid_services
227
227
assert isinstance (identifier , six .string_types )
228
228
assert isinstance (identifier_type , six .string_types )
229
229
obj = list_service_user_groups (service )
230
- out = nipyapi .utils .filter_obj (obj , identifier , identifier_type )
230
+ out = nipyapi .utils .filter_obj (obj , identifier , identifier_type , greedy = False )
231
231
return out
232
232
233
233
0 commit comments