]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-volume: log: use new config module
authorAlfredo Deza <adeza@redhat.com>
Thu, 6 Jul 2017 19:13:35 +0000 (15:13 -0400)
committerAlfredo Deza <adeza@redhat.com>
Fri, 4 Aug 2017 14:25:57 +0000 (10:25 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/log.py

index b78752acea6e7b3f3285980e2a3d60a22ae1ea4f..8ff38b5bd5196c0d6f868f1bedd1568adbfa6a54 100644 (file)
@@ -1,6 +1,7 @@
 import logging
 import os
-from ceph_volume import config, terminal
+from ceph_volume import terminal
+from ceph_volume import conf
 
 BASE_FORMAT = "[%(name)s][%(levelname)-6s] %(message)s"
 FILE_FORMAT = "[%(asctime)s]" + BASE_FORMAT
@@ -15,19 +16,19 @@ def setup(name='ceph-volume.log'):
     # The default path is where all ceph log files are, and will get rotated by
     # Ceph's logrotate rules.
     default_log_path = os.environ.get('CEPH_VOLUME_LOG_PATH', '/var/log/ceph/')
-    log_path = config.get('--log-path', default_log_path)
+    log_path = conf.ceph_volume.get('--log-path', default_log_path)
     log_file = os.path.join(log_path, 'ceph-volume.log')
 
     root_logger.setLevel(logging.DEBUG)
 
     # File Logger
-    config['log_path'] = log_file
+    conf.ceph_volume['log_path'] = log_file
     try:
         fh = logging.FileHandler(log_file)
     except (OSError, IOError) as err:
         terminal.warning("Falling back to /tmp/ for logging. Can't use %s" % log_file)
         terminal.warning(str(err))
-        config['log_path'] = tmp_log_file
+        conf.ceph_volume['log_path'] = tmp_log_file
         fh = logging.FileHandler(tmp_log_file)
 
     fh.setLevel(logging.DEBUG)