pyTenable icon indicating copy to clipboard operation
pyTenable copied to clipboard

Bug: AttributeError: 'VersionInfo' object has no attribute 'match' for semver<2.10.0

Open slallum opened this issue 2 years ago • 0 comments

Semver is listed as >=2.8.1 in the dependencies, but any version before 2.10.0 will cause the bug:

  File "tenable_sc_client.py", line 41, in setup
    self._tenable_sc = sc.TenableSC(self._host, self._access_key, self._secret_key, retries=1)
  File "site-packages/tenable/sc/__init__.py", line 209, in __init__
    super().__init__(**kwargs)
  File "site-packages/tenable/base/platform.py", line 102, in __init__
    super().__init__(**kwargs)
  File "site-packages/restfly/session.py", line 236, in __init__
    self._authenticate(**kwargs)
  File "site-packages/tenable/base/platform.py", line 166, in _authenticate
    kwargs['key_auth_func'](**keys)
  File "site-packages/tenable/sc/__init__.py", line 232, in _key_auth
    or VersionInfo.parse(self.version).match('>=5.13.0')
AttributeError: 'VersionInfo' object has no attribute 'match'

To Reproduce Steps to reproduce the behavior:

  1. Use Tenable.SC version: 5.20
  2. Call from tenable import sc; sc.TenableSC(host, access_key, secret_key, retries=1)
  3. See error

Expected behavior no error :)

System Information (please complete the following information):

  • OS: MacOS
  • Architecture 64bit
  • Version pyTenable==1.4.3

Additional context Pretty sure this bug was introduced by PR #315 (which solves #314)

slallum avatar Jun 06 '22 16:06 slallum