Skip to content

Commit

Permalink
Disallow minor version mismatching until vcap's major version is >= 1 (
Browse files Browse the repository at this point in the history
  • Loading branch information
apockill authored Jul 1, 2021
1 parent cbd8bd9 commit 60c605b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions vcap/vcap/loading/capsule_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ def load_capsule_from_bytes(data: bytes,
f"capsule's OpenVisionCapsules required major version is "
f"{major} but this software uses OpenVisionCapsules "
f"{MAJOR_COMPATIBLE_VERSION}.{MINOR_COMPATIBLE_VERSION}.")
elif (MAJOR_COMPATIBLE_VERSION == 0
and minor != MINOR_COMPATIBLE_VERSION):
# Because vcap has not yet reached a 1.0 API, while the major
# version is 0 then minor version will be required to match.
raise IncompatibleCapsuleError(
"The capsule is not compatible with this software. The "
"capsule's OpenVisionCapsules required version is "
f"{major}.{minor}, but this software uses OpenVisionCapsules "
f"{MAJOR_COMPATIBLE_VERSION.MINOR_COMPATIBLE_VERSION}"
)

if minor > MINOR_COMPATIBLE_VERSION:
raise IncompatibleCapsuleError(
f"The capsule requires a version of OpenVisionCapsules "
Expand Down

0 comments on commit 60c605b

Please sign in to comment.