python-foreman
python-foreman copied to clipboard
search_resource return type
Hi, could you explain why you change the type of the search_resource function ?
if len(result) == 1:
return result[0]
I can always do a workaround by testing the type before using it, but I don't understand the logic - I'd prefer a function that returns a list of one element.
Regards, Arnaud
Hi @mathiear,
fully understand your question. Returning sometimes a dictionary but other times a list is confusing. Honestly, it's long time ago that a wrote the code. Please give me some time to remember and test and answer your question.