#3204 lib: refactor variables in is_conn_err()
Merged by tkopecek. Opened by ktdreyer.
ktdreyer/koji refactor-errno-list  into  master

Download 3204.patch

Move the copy-and-pasted list of errnos into an ERRNOS variable and use that in both places.

Rename the e2 variable to something easier to understand.

This makes this code easier to read.

To test this out:

  1. Apply this patch to your client

  2. Run "koji watch-task" on a ongoing task ID, for example:
    koji watch-task 123456

  3. Block outgoing connections to your Koji hub's IP, for example:
    firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -d 10.0.0.100/32 -j REJECT

  4. Wait a while for koji watch-task to fail, like so:
    2022-01-04 16:23:33,650 [ERROR] koji: ConnectionError: HTTPSConnectionPool(host='koji.example.com', port=443): Max retries exceeded with url: /kojihub (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe6a616ec10>: Failed to establish a new connection: [Errno 111] Connection refused'))

  5. To remove the firewalld rule from your local client after you're done testing:
    firewall-cmd --direct --remove-rule ipv4 filter OUTPUT 0 -d 10.0.0.100/32 -j REJECT

:thumbsup:

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

Metadata Update from @tkopecek:
- Pull-request untagged with: testing-ready
- Pull-request tagged with: no_qe

Commit 213c1eae fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata