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
a8262d20
Commit
a8262d20
authored
Sep 09, 2013
by
Stavros Sachtouris
Browse files
Add output stream to astakos print methods
parent
b6ce2fde
Changes
2
Hide whitespace changes
Inline
Side-by-side
kamaki/cli/commands/astakos.py
View file @
a8262d20
...
...
@@ -34,7 +34,7 @@
from
kamaki.cli
import
command
from
kamaki.clients.astakos
import
AstakosClient
from
kamaki.cli.commands
import
(
_command_init
,
errors
,
_optional_json
,
addLogSettings
)
_command_init
,
errors
,
_optional_json
,
addLogSettings
,
stdout
)
from
kamaki.cli.command_tree
import
CommandTree
from
kamaki.cli.errors
import
CLIBaseUrlError
,
CLIError
from
kamaki.cli.utils
import
print_dict
,
ask_user
...
...
@@ -88,8 +88,8 @@ class user_authenticate(_user_init, _optional_json):
"""
@
staticmethod
def
_print_access
(
r
):
print_dict
(
r
[
'access'
])
def
_print_access
(
r
,
out
=
stdout
):
print_dict
(
r
[
'access'
]
,
out
=
out
)
@
errors
.
generic
.
all
@
errors
.
user
.
authenticate
...
...
kamaki/clients/__init__.py
View file @
a8262d20
...
...
@@ -149,9 +149,10 @@ class RequestManager(Logged):
sendlog
.
info
(
'%s %s://%s%s%s'
%
(
self
.
method
,
self
.
scheme
,
self
.
netloc
,
self
.
path
,
plog
))
for
key
,
val
in
self
.
headers
.
items
():
if
(
not
self
.
LOG_TOKEN
)
and
key
.
lower
()
==
'x-auth-token'
:
continue
sendlog
.
info
(
' %s: %s%s'
%
(
key
,
val
,
plog
))
#if (not self.LOG_TOKEN) and key.lower() == 'x-auth-token':
# continue
show
=
(
key
.
lower
()
!=
'x-auth-token'
)
or
self
.
LOG_TOKEN
sendlog
.
info
(
' %s: %s%s'
%
(
key
,
val
if
show
else
''
,
plog
))
if
self
.
data
:
sendlog
.
info
(
'data size:%s%s'
%
(
len
(
self
.
data
),
plog
))
if
self
.
LOG_DATA
:
...
...
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