From f79097cae9fbe7894c31a6c0237619c51728725a Mon Sep 17 00:00:00 2001 From: meow Date: Tue, 24 Dec 2019 15:27:21 +0500 Subject: [PATCH] Fix logging --- scripts/ucloud | 2 +- ucloud/imagescanner/main.py | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/scripts/ucloud b/scripts/ucloud index 5e8bce6..3ddbb5a 100755 --- a/scripts/ucloud +++ b/scripts/ucloud @@ -47,7 +47,7 @@ if __name__ == '__main__': arg_parser.print_help() else: # Setting up root logger - logger = logging.getLogger(__name__) + logger = logging.getLogger('ucloud') syslog_handler = SysLogHandler(address='/dev/log') syslog_handler.setLevel(logging.DEBUG) diff --git a/ucloud/imagescanner/main.py b/ucloud/imagescanner/main.py index 0d2fbf2..e215c88 100755 --- a/ucloud/imagescanner/main.py +++ b/ucloud/imagescanner/main.py @@ -1,9 +1,7 @@ import json import os import subprocess as sp -import sys -from os.path import isdir from os.path import join as join_path from ucloud.settings import settings 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")) 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(): # We want to get images entries that requests images to be created