Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_app_by_name() returns only first item from application list #9

Closed
Lok33 opened this issue Mar 14, 2018 · 2 comments
Closed

get_app_by_name() returns only first item from application list #9

Lok33 opened this issue Mar 14, 2018 · 2 comments

Comments

@Lok33
Copy link

Lok33 commented Mar 14, 2018

The Tufin API returns a list of applications by name, if you call https:///securechangeworkflow/api/secureapp/repository/applications?name=.
The corresponding function in pytos.secureapp.helpers.get_app_by_name() will only return the first item of that list.
Say we got applications "amapp" and "map app" and one wants to obtain "map app" from SecureApp by calling get_app_by_name("map app") and verify the result.
Calling https:///securechangeworkflow/api/secureapp/repository/applications?name=map%20app will return a list of applications including "amapp" and "map app" in that order.
Since get_app_by_name will only return the first item, the returned application is "amapp" which leads to the assumption that "map app" does not exist in SecureApp yet which is not correct.

This issue consequently occurrs when calling functions using get_app_by_name implicitly like get_network_obejcts_list_for_app_name.

@Lok33 Lok33 changed the title get_app_by_name returns only first item from application list get_app_by_name() returns only first item from application list Mar 14, 2018
@funkycode
Copy link
Collaborator

Hey,
In general there is difference between what API actually does and returns vs the functionality of the library.
The function works correctly that it returns only single application.
Though you are correct that there is bug - as it should return correct application.
We will fix it - so library searches for exact name from the list of application we got from API. Probably API uses 'LIKE' underneath of filtration instead of '=' and that causes the problem.

geewrd added a commit to geewrd/pytos that referenced this issue Mar 22, 2018
geewrd added a commit to geewrd/pytos that referenced this issue Apr 18, 2018
geewrd added a commit to geewrd/pytos that referenced this issue Apr 18, 2018
@tgratzi
Copy link
Collaborator

tgratzi commented Apr 28, 2018

Added

@tgratzi tgratzi closed this as completed Apr 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants