Fix issues in naming and few other things
This commit is contained in:
parent
f919719b1e
commit
71279a968f
21 changed files with 274 additions and 281 deletions
|
|
@ -5,11 +5,17 @@ import logging
|
|||
import importlib
|
||||
import sys
|
||||
import os
|
||||
import multiprocessing as mp
|
||||
|
||||
|
||||
COMMANDS = ['api', 'scheduler', 'host', 'filescanner', 'imagescanner', 'metadata']
|
||||
|
||||
if __name__ == "__main__":
|
||||
log = logging.getLogger("ucloud")
|
||||
logging.basicConfig(level=logging.DEBUG,
|
||||
format='%(pathname)s:%(lineno)d -- %(levelname)-8s %(message)s',
|
||||
filename='/var/log/ucloud.log', filemode='a')
|
||||
|
||||
logger = logging.getLogger("ucloud")
|
||||
|
||||
arg_parser = argparse.ArgumentParser(prog='ucloud',
|
||||
description='Open Source Cloud Management Software')
|
||||
|
|
@ -22,12 +28,12 @@ if __name__ == "__main__":
|
|||
os.environ['UCLOUD_CONF_DIR'] = args.conf_dir
|
||||
|
||||
try:
|
||||
mp.set_start_method('spawn')
|
||||
name = args.component
|
||||
mod = importlib.import_module("ucloud.{}.main".format(name))
|
||||
main = getattr(mod, "main")
|
||||
|
||||
main()
|
||||
main(*args.component_args)
|
||||
|
||||
except Exception as e:
|
||||
logging.exception(e)
|
||||
logger.exception(e)
|
||||
print(e)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue