Files
OpenNetworkLinux/tools/onlvi.py
Jeffrey Townsend a707bec39a New SYSTEM_COMPATIBILITY_VERSION (SCV) key
This key is designed to indicate the overall system compatibility between different installations.
For example, the system configuration in ONL2.0 is different from ONL 1.0 (partition scheme, loader/version management, etc) and attempting to boot a 1.0 switch image on a 2.0 system will not work properly.

This key exists to facilitate operational compatibility and upgrade steps. When a switch image is booted against a loader with an SCV different than it expects then a full re-install will need to be performed in order to upgrade the system before that image can run. If the SCV is different then an in-place loader-upgrade cannot be performed either.

The upgrade process will be updated to include an SCV check and perform a re-install.
The loader upgrade sequence will be predicated on SCV equality.

If the SCV is not equal after all upgrade operations then switch has the option of rebooting instead of continuing the init process.
This will be configured through the sysconfig interface.
2016-10-25 18:07:26 +00:00

58 lines
1.7 KiB
Python

class OnlVersionImplementation(object):
PRODUCTS = [
{
"id" : "ONL",
"version": "2.0.0"
}
]
def V_OS_NAME(self, data):
return "Open Network Linux OS"
def V_BUILD_SHA1(self, data):
return data['build_sha1']
def V_BUILD_SHORT_SHA1(self, data):
return self.V_BUILD_SHA1(data)[0:7]
def V_BUILD_TIMESTAMP(self, data):
return data['build_timestamp']
def V_FNAME_BUILD_TIMESTAMP(self, data):
return self.V_BUILD_TIMESTAMP(data).replace(':', '')
def V_BUILD_ID(self, data):
return "%s-%s" % (self.V_BUILD_TIMESTAMP(data), self.V_BUILD_SHORT_SHA1(data))
def V_FNAME_BUILD_ID(self, data):
return "%s-%s" % (self.V_FNAME_BUILD_TIMESTAMP(data), self.V_BUILD_SHORT_SHA1(data))
def V_PRODUCT_ID_VERSION(self, data):
return data['product']['version']
def V_VERSION_ID(self, data):
return "ONL-%s" % (self.V_PRODUCT_ID_VERSION(data))
def V_FNAME_VERSION_ID(self, data):
return self.V_VERSION_ID(data)
def V_PRODUCT_VERSION(self, data):
return "ONL-%s" % (self.V_PRODUCT_ID_VERSION(data))
def V_FNAME_PRODUCT_VERSION(self, data):
return "ONL-%s" % (self.V_PRODUCT_ID_VERSION(data))
def V_VERSION_STRING(self, data):
return "%s %s, %s" % (self.V_OS_NAME(data), self.V_VERSION_ID(data), self.V_BUILD_ID(data))
def V_RELEASE_ID(self, data):
return "%s,%s" % (self.V_VERSION_ID(data), self.V_BUILD_ID(data))
def V_FNAME_RELEASE_ID(self, data):
return "%s-%s" % (self.V_VERSION_ID(data), self.V_FNAME_BUILD_ID(data))
def V_SYSTEM_COMPATIBILITY_VERSION(self, data):
return "2"