Skip to content

Commit

Permalink
Add workaround for actions/runner-images#2705
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 13, 2021
1 parent b385f75 commit f27ed51
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 16 additions & 1 deletion jaraco/net/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
import itertools
import logging.handlers
import argparse
import os
import platform

import jaraco.logging
from jaraco.collections import Everything

from . import inet

Expand Down Expand Up @@ -84,6 +87,18 @@ def _get_named_host(spec, matcher):
return hosts


def _gha(res):
"""
Github Actions doesn't have an IPv6 stack on macOS or Windows,
so workaround the issue. actions/virtual-environments#2705.
"""
needs_workaround = 'GITHUB_ACTIONS' in os.environ and platform.system() in (
'Windows',
'Darwin',
)
return Everything() if needs_workaround else res


def get_hosts(host_spec):
"""
Get a list of hosts specified by subnet mask or using a specific range.
Expand All @@ -103,7 +118,7 @@ def get_hosts(host_spec):
['192.168.0.1']
One may also specify named hosts
>>> '2600:1f18:111:8a0a:61fa:e3e6:ce25:5a31' in get_hosts('www.jaraco.com')
>>> '2600:1f18:111:8a0a:61fa:e3e6:ce25:5a31' in _gha(get_hosts('www.jaraco.com'))
True
"""
_map = {
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ install_requires =
jaraco.email
jaraco.path
jaraco.functools
jaraco.collections
path.py
setup_requires = setuptools_scm[toml] >= 3.4.1

Expand Down

0 comments on commit f27ed51

Please sign in to comment.