How to use the sceptre.exceptions.VersionIncompatibleError function in sceptre

To help you get started, we’ve selected a few sceptre examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Sceptre / sceptre / tests / test_config.py View on Github external
def test_aborts_on_incompatible_version_requirement(self):
        self.config['require_version'] = '<0'
        with pytest.raises(VersionIncompatibleError):
            self.config._check_version()
github Sceptre / sceptre / tests / test_config_reader.py View on Github external
def test_aborts_on_incompatible_version_requirement(self):
        config = {
            'required_version': '<0'
        }
        with pytest.raises(VersionIncompatibleError):
            ConfigReader(self.context)._check_version(config)
github Sceptre / sceptre / sceptre / config / reader.py View on Github external
def _check_version(self, config):
        """
        Raises a VersionIncompatibleException when the current Sceptre version
        does not comply with the configured version requirement.

        :raises: sceptre.exceptions.VersionIncompatibleException
        """
        sceptre_version = __version__
        if 'required_version' in config:
            required_version = config['required_version']
            if Version(sceptre_version) not in SpecifierSet(required_version, True):
                raise VersionIncompatibleError(
                    "Current sceptre version ({0}) does not meet version "
                    "requirements: {1}".format(
                        sceptre_version, required_version
                    )
github Sceptre / sceptre / sceptre / config.py View on Github external
def _check_version(self):
        """
        Raises a VersionIncompatibleException when the current sceptre version
        does not comply with the configured version requirement.

        :raises: sceptre.exceptions.VersionIncompatibleException
        """
        sceptre_version = __version__
        if self.name == 'config' and 'require_version' in self:
            require_version = self['require_version']
            if Version(sceptre_version) not in SpecifierSet(require_version):
                raise VersionIncompatibleError(
                    "Current sceptre version ({0}) does not meet version "
                    "requirements: {1}".format(
                        sceptre_version, require_version
                    )