Update: dockerize app, rename pkg to mgrctl, fix imports

This commit is contained in:
2024-06-03 18:58:27 +09:00
parent 34e8118327
commit 0f96d0f956
50 changed files with 309 additions and 94 deletions

0
mgrctl/utils/__init__.py Normal file
View File

23
mgrctl/utils/helpers.py Normal file
View File

@@ -0,0 +1,23 @@
import json
import sys
import click
def parse_json_file(file_path: str) -> dict:
"""
Function read json file as usual config.json then parse it to python dict
Args:
config_file_path (str): path to config file
Returns:
dict: contains parse json content
"""
try:
with open(file_path, 'r') as f:
return json.load(f)
except Exception as error:
click.echo(error)
click.echo("Required: /opt/ispsystem/PLATFORM_TYPE/config.json")
click.echo("Note: don't forget to mount this file into the container")
sys.exit(1)