If the passed version begins with v, eg. it's a tag, remove it before comparison.

This commit is contained in:
Gareth J. Greenaway 2023-04-20 13:01:58 -07:00
parent 719422adfe
commit e7c8f7698b
No known key found for this signature in database
GPG key ID: 10B62F8A7CAD7A41

View file

@ -1,8 +1,9 @@
import logging
import os
import pprint
import pytest
import testinfra
import logging
log = logging.getLogger(__name__)
@ -47,6 +48,8 @@ def target_python_version():
@pytest.fixture(scope="session")
def target_salt_version():
target_salt = os.environ["KITCHEN_SUITE"].split("-", 2)[-1].replace("-", ".")
if target_salt.startswith("v"):
target_salt = target_salt[1:]
if target_salt in ("latest", "master", "nightly"):
pytest.skip("Don't have a specific salt version to test against")
return target_salt