Forbid upgrade in flight when cas_disk is older than 20.01

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2020-01-29 07:29:07 -05:00
parent a0937758b7
commit 8c73bc2f5a

View File

@ -35,6 +35,8 @@ CAS_CACHE_KEY = "CAS Cache Kernel Module"
CAS_DISK_KEY = "CAS Disk Kernel Module"
CAS_CLI_KEY = "CAS CLI Utility"
CAS_DISK_MIN_VER = 20
OCL_BUILD_ROOT = f"{os.path.dirname(__file__)}/.."
@ -58,6 +60,11 @@ class InitUpgrade(UpgradeState):
except Exception as e:
return Failure(f"Failed to get current version of CAS {e}")
# Although there shouldn't be any problem with upgrade from CAS 19.9 to newer, this feature
# is not full validated so it is disabled by default.
if (int(version[CAS_DISK_KEY].split('.')[0]) < CAS_DISK_MIN_VER):
return Failure(f"Minimal cas_disk version required to perform upgrade is 20.01!")
if version[CAS_CLI_KEY] != version[CAS_CACHE_KEY]:
return Failure("Mismatch between CLI and cas_cache version")