Projet

Général

Profil

0001-ldapsync-add-debug-mode.patch

Benjamin Renard, 12 avril 2022 11:44

Télécharger (1,23 ko)

Voir les différences:

Subject: [PATCH 1/3] ldapsync: add debug mode

 src/ldaptools/ldapsync/cmd.py | 11 +++++++++++
 1 file changed, 11 insertions(+)
src/ldaptools/ldapsync/cmd.py
1 1
from __future__ import print_function
2 2

  
3 3
import argparse
4
import logging
4 5
import sys
5 6

  
6 7
import ldap.sasl
......
131 132
    parser.add_argument('--verbose',
132 133
                        action='store_true',
133 134
                        help='print all actions to stdout')
135
    parser.add_argument('--debug',
136
                        action='store_true',
137
                        help='enable debug mode')
134 138

  
135 139
    options = parser.parse_args(args=args)
136 140

  
141
    logging.basicConfig(
142
        level=(
143
            logging.DEBUG if options.debug
144
            else (logging.INFO if options.verbose else logging.WARNING)
145
        )
146
    )
147

  
137 148
    attributes = set()
138 149

  
139 150
    if options.attributes_file:
140
-