]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
cloud: configure the generic drivers python logger in non-debug mode
authornorbert.bizet <norbert.bizet@baculasystems.com>
Wed, 17 Aug 2022 11:53:38 +0000 (07:53 -0400)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:58 +0000 (13:56 +0200)
bacula/scripts/aws_cloud_driver.in

index e63d7ab1376d93ae9371d4f6eb4a0cd9e8458f04..1986889ed31118de77b03e21c66dac078ae7d308 100755 (executable)
@@ -27,7 +27,7 @@ import sys, os, json, time
 from subprocess import Popen, PIPE, call
 from multiprocessing import Pool, cpu_count
 from inspect import stack
-import logging
+import logging, traceback
 
 
 # RETRY DOWNLOAD
@@ -55,7 +55,7 @@ def vol_ls():
          return 0
       return proc.returncode
    except OSError as o:
-      logging.exception("vol_ls OSError exception")
+      logging.error("vol_ls OSError exception")
       sys.stderr.write("{2} OSError({0}): {1}\0".format(o.errno, o.strerror, stack()[0][3]))
    except ValueError as v:
       logging.exception("vol_ls ValueError exception")
@@ -293,6 +293,8 @@ if __name__ == '__main__':
 
    if ('CLOUD_DEBUG' in os.environ) and os.environ['CLOUD_DEBUG']:
       logging.basicConfig(filename='@working_dir@/aws_cloud_driver.log', level=logging.DEBUG, filemode='a', format='%(asctime)-15s-%(process)d- %(levelname)s -%(message)s')
+   else:
+      logging.basicConfig(level=logging.CRITICAL)
 
    try:
       if len(sys.argv) < 3: