Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
49c4cc3a
Commit
49c4cc3a
authored
5 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-139
: repair 3rd party logging errors
parent
559e3136
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!96
Resolve TMSS-139
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/test/ldap_test_service.py
+9
-6
9 additions, 6 deletions
SAS/TMSS/test/ldap_test_service.py
with
9 additions
and
6 deletions
SAS/TMSS/test/ldap_test_service.py
+
9
−
6
View file @
49c4cc3a
...
@@ -2,14 +2,17 @@ import os
...
@@ -2,14 +2,17 @@ import os
import
logging
import
logging
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
logging_already_configured
=
len
(
logging
.
root
.
handlers
)
>
0
from
ldap_test
import
LdapServer
from
ldap_test
import
LdapServer
# the 3rd party ldap_test module erroneously does a logging.basicConfig upon module import...
if
not
logging_already_configured
:
# logging.basicConfig should only happen in 'main'-like functions.
# the 3rd party ldap_test module erroneously does a logging.basicConfig upon module import...
# so, undo the basicConfig by removing the root handlers.
# logging.basicConfig should only happen in 'main'-like functions.
# See: https://docs.python.org/3/library/logging.html#logging.basicConfig
# so, undo the basicConfig by removing the root handlers.
for
h
in
logging
.
root
.
handlers
:
# See: https://docs.python.org/3/library/logging.html#logging.basicConfig
logging
.
root
.
removeHandler
(
h
)
for
h
in
logging
.
root
.
handlers
:
logging
.
root
.
removeHandler
(
h
)
from
optparse
import
OptionParser
from
optparse
import
OptionParser
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment