add get_service_with_docs_by_service_type() #35

Merged
zuul merged 2 commits from service_by_service_type into main 2023-02-21 10:44:52 +00:00
Owner
tischrei added 1 commit 2023-02-20 13:51:25 +00:00
add get_service_with_docs_by_service_type()
All checks were successful
gl/check check status: success (44320ea668c58f6f70db2aa50fdbaa689403ef87)
44320ea668
Member
Build succeeded. https://zuul.otc-service.com/t/gl/buildset/40839dd46402477e9783b92fc3fe3bbe - [otc-tox-pep8 ](https://zuul.otc-service.com/t/gl/build/95137a8c217f44bf9c22be85168479e5): SUCCESS in 2m 13s - [otc-tox-py39 ](https://zuul.otc-service.com/t/gl/build/3d2212cc112548fd90211bb764195caa): SUCCESS in 2m 29s
vhasko reviewed 2023-02-20 18:26:02 +00:00
@ -212,0 +226,4 @@
for service in services['services']:
if service['service_type'] == service_type:
res['service'] = service
break
Owner

why break is required here? There’s only unique service_type in services so after the if condition for the matching service_type you should get exactly one matching res[‘service’] even after completing the loop.

why break is required here? There's only unique service_type in services so after the if condition for the matching service_type you should get exactly one matching res['service'] even after completing the loop.
Author
Owner

You are right, that the break is not necessary. The reason I use it here is to shorten the runtime a bit. The loop breaks because 1 result is expected, otherwise the loop would run further which is not necessary and results in larger runtime of this loop.

You are right, that the break is not necessary. The reason I use it here is to shorten the runtime a bit. The loop breaks because 1 result is expected, otherwise the loop would run further which is not necessary and results in larger runtime of this loop.
tischrei marked this conversation as resolved
tischrei added 1 commit 2023-02-21 10:36:25 +00:00
minor change
All checks were successful
gl/check check status: success (bf1f3f7afe1d1015e70d17921d88d563ba438ce5)
gl/gate gate status: success (bf1f3f7afe1d1015e70d17921d88d563ba438ce5)
bf1f3f7afe
vhasko approved these changes 2023-02-21 10:37:00 +00:00
Member
Build succeeded. https://zuul.otc-service.com/t/gl/buildset/bfe27bd4fd7e4ce2bb866ac37b110d99 - [otc-tox-pep8 ](https://zuul.otc-service.com/t/gl/build/2f610d5a79cb482eb4fa089bf3d44c11): SUCCESS in 2m 20s - [otc-tox-py39 ](https://zuul.otc-service.com/t/gl/build/3986eece1bd54f2b91408459e0ee646b): SUCCESS in 2m 42s
tischrei added the
gate
label 2023-02-21 10:41:35 +00:00
Member
Build succeeded. https://zuul.otc-service.com/t/gl/buildset/4dac254a5b4747a6b878c80f47355f28 - [otc-tox-pep8 ](https://zuul.otc-service.com/t/gl/build/7fc8515112d84aaabb0444f57375209f): SUCCESS in 2m 24s - [otc-tox-py39 ](https://zuul.otc-service.com/t/gl/build/c11eb08c6b804ab5bae3f4b4ddbf5b5e): SUCCESS in 2m 54s
zuul merged commit 8de5c8ba57 into main 2023-02-21 10:44:52 +00:00
Sign in to join this conversation.
No Reviewers
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: infra/otc-metadata#35
No description provided.