python-foreman icon indicating copy to clipboard operation
python-foreman copied to clipboard

search_resource return type

Open mathiear opened this issue 8 years ago • 1 comments

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

mathiear avatar Nov 28 '16 13:11 mathiear

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.

Nosmoht avatar Nov 29 '16 17:11 Nosmoht