def fail_on_unknown_version(version, properties): versions = Versions() version_loader = VersionLoader(versions) version_loader.load(properties) versions.sort() if not versions.exists(Version(version)): message = "the given version is not valid for this project" raise PluginException(message)
def fail_on_unknown_version(version, properties): """Verify that ``version`` is valid for this project""" versions = Versions() version_loader = VersionLoader(versions) version_loader.load(properties) versions.sort() if not versions.exists(Version(version)): raise UnknownVersionException( "version {} is not valid for this project".format(version))