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

url_check source plugin doesn't seem handle exceptions on individual URLs in list #165

Open
cloin opened this issue Aug 14, 2023 · 1 comment

Comments

@cloin
Copy link

cloin commented Aug 14, 2023

The arguments for this source plugin suggests a list of URLs is supported but, in testing the plugin in a rulebook, but the loop dies on exception. This may be due to the try-except block being outside the for loop but I'm not sure. The test only handles one url.

https://github.com/ansible/event-driven-ansible/blob/main/extensions/eda/plugins/event_source/url_check.py

---
- name: Web Site Checks Rulebook
  hosts: all
  
  sources:
    - name: Are my key web sites operational
      ansible.eda.url_check:
        verify_ssl: false
        delay: 30 # seconds
        urls:
          - https://status.redhat.com
          - https://www.anothercrapwsite.co.uk
          - http://loadofrubbishurl.com

In the above, the first two URLs are valid. The loop dies in the except on the second URL which is a bad URL and never reaches the third URL.

@cloin cloin closed this as completed Aug 14, 2023
@cloin cloin reopened this Aug 14, 2023
@cloin cloin changed the title url_check source seems to only check the first url in list url_check source plugin doesn't seem handle exceptions on individual URLs in list Aug 14, 2023
@Alex-Izquierdo
Copy link
Contributor

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

2 participants