1 Star 0 Fork 45

SkyCat/codo-cmdb

forked from opendevops/codo-cmdb 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
startup.py 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
yanghongfei 提交于 2019-09-27 15:43 . [Add]CMDB Beta0.4功能
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/4/17 9:52
# @Author : Fred Yangxiaofei
# @File : startup.py
# @Role : 启动脚本
import fire
from tornado.options import define
from websdk.program import MainProgram
from settings import settings as app_settings
from biz.applications import Application as CmdbApp
from biz.crontab_app import Application as CronApp
define("service", default='api', help="start service flag", type=str)
class MyProgram(MainProgram):
def __init__(self, service='cmdb_api', progressid=''):
self.__app = None
settings = app_settings
if service == 'cmdb':
self.__app = CmdbApp(**settings)
elif service == 'cmdb_cron':
self.__app = CronApp(**settings)
super(MyProgram, self).__init__(progressid)
self.__app.start_server()
if __name__ == '__main__':
fire.Fire(MyProgram)
"""
#master
python3 startup.py --service='cmdb' --port=8055
#crontab
python3 startup.py --service='cmdb_cron'
"""
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/etjy/codo-cmdb.git
[email protected]:etjy/codo-cmdb.git
etjy
codo-cmdb
codo-cmdb
master

搜索帮助