Fix logging

This commit is contained in:
ahmadbilalkhalid 2019-12-24 15:27:21 +05:00
parent 972bb5a920
commit f79097cae9
2 changed files with 1 additions and 16 deletions

View File

@ -47,7 +47,7 @@ if __name__ == '__main__':
arg_parser.print_help() arg_parser.print_help()
else: else:
# Setting up root logger # Setting up root logger
logger = logging.getLogger(__name__) logger = logging.getLogger('ucloud')
syslog_handler = SysLogHandler(address='/dev/log') syslog_handler = SysLogHandler(address='/dev/log')
syslog_handler.setLevel(logging.DEBUG) syslog_handler.setLevel(logging.DEBUG)

View File

@ -1,9 +1,7 @@
import json import json
import os import os
import subprocess as sp import subprocess as sp
import sys
from os.path import isdir
from os.path import join as join_path from os.path import join as join_path
from ucloud.settings import settings from ucloud.settings import settings
from ucloud.shared import shared from ucloud.shared import shared
@ -21,19 +19,6 @@ def qemu_img_type(path):
qemu_img_info = json.loads(qemu_img_info.decode("utf-8")) qemu_img_info = json.loads(qemu_img_info.decode("utf-8"))
return qemu_img_info["format"] return qemu_img_info["format"]
def check():
""" check whether settings are sane, refuse to start if they aren't """
if settings['storage']['storage_backend'] == 'filesystem' and not isdir(settings['storage']['image_dir']):
sys.exit("You have set STORAGE_BACKEND to filesystem, but "
"{} does not exist. Refusing to start".format(settings['storage']['image_dir'])
)
try:
sp.check_output(['which', 'qemu-img'])
except Exception:
print("qemu-img missing")
sys.exit(1)
def main(): def main():
# We want to get images entries that requests images to be created # We want to get images entries that requests images to be created