Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
kamaki
Commits
2406db97
Commit
2406db97
authored
Mar 22, 2013
by
Stavros Sachtouris
Browse files
Disable token logging (synnefo bug #3480)
parent
f09da8c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
kamaki/clients/__init__.py
View file @
2406db97
...
...
@@ -41,7 +41,9 @@ from kamaki.clients.connection.kamakicon import KamakiHTTPConnection
from
kamaki.clients.connection.errors
import
KamakiConnectionError
from
kamaki.clients.connection.errors
import
KamakiResponseError
LOG_TOKEN
=
False
DEBUG_LOG
=
get_log_filename
()
add_file_logger
(
'clients.send'
,
__name__
,
filename
=
DEBUG_LOG
)
sendlog
=
get_logger
(
'clients.send'
)
sendlog
.
debug
(
'Logging location: %s'
%
DEBUG_LOG
)
...
...
@@ -224,6 +226,8 @@ class Client(object):
headers
.
update
(
async_headers
)
for
key
,
val
in
headers
.
items
():
if
(
not
LOG_TOKEN
)
and
key
.
lower
()
==
'x-auth-token'
:
continue
sendlog
.
info
(
'
\t
%s: %s'
,
key
,
val
)
sendlog
.
info
(
''
)
if
data
:
...
...
@@ -231,6 +235,8 @@ class Client(object):
recvlog
.
info
(
'%d %s'
,
r
.
status_code
,
r
.
status
)
for
key
,
val
in
r
.
headers
.
items
():
if
(
not
LOG_TOKEN
)
and
key
.
lower
()
==
'x-auth-token'
:
continue
recvlog
.
info
(
'%s: %s'
,
key
,
val
)
if
r
.
content
:
datarecvlog
.
info
(
r
.
content
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment