1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-5496: Merge CMAPI code to engine repo.

[add] cmapi code to engine
This commit is contained in:
mariadb-AlanMologorsky
2022-11-18 15:18:40 +02:00
committed by Alan Mologorsky
parent 77eedd1756
commit a079a2c944
93 changed files with 15218 additions and 0 deletions

View File

@ -0,0 +1,29 @@
import logging
from typing import Optional
from cmapi_server.constants import VERSION_PATH
class AppManager:
started: bool = False
version: Optional[str] = None
@classmethod
def get_version(cls) -> str:
"""Get CMAPI version.
:return: cmapi version
:rtype: str
"""
if cls.version:
return cls.version
with open(VERSION_PATH, encoding='utf-8') as version_file:
version = '.'.join([
i.strip().split('=')[1]
for i in version_file.read().splitlines() if i
])
if not version:
logging.error('Couldn\'t detect version from VERSION file!')
version = 'Undefined'
cls.version = version
return cls.version