Browse Source

Set paramiko logging to DEBUG level

Connections to backends via paramiko often fail for obscure
reasons.

If the service log level is DEBUG, increase paramiko logging
to DEBUG level as well so that we have more information when issues
of this sort occur.

Change-Id: I44d8902d58c2ad48b8a37dfbff96c5b9471651e4
(cherry picked from commit 575d6ae621)
(cherry picked from commit 0cde7b098d)
(cherry picked from commit 0b47c687e0)
(cherry picked from commit 2eb8268da9)
changes/63/630963/2
Tom Barron 4 months ago
parent
commit
98653a838f
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      manila/utils.py

+ 3
- 0
manila/utils.py View File

@@ -20,6 +20,7 @@
20 20
 import contextlib
21 21
 import functools
22 22
 import inspect
23
+import logging
23 24
 import os
24 25
 import pyclbr
25 26
 import random
@@ -52,6 +53,8 @@ from manila.i18n import _
52 53
 
53 54
 CONF = cfg.CONF
54 55
 LOG = log.getLogger(__name__)
56
+if hasattr('CONF', 'debug') and CONF.debug:
57
+    logging.getLogger("paramiko").setLevel(logging.DEBUG)
55 58
 
56 59
 synchronized = lockutils.synchronized_with_prefix('manila-')
57 60
 

Loading…
Cancel
Save