Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
synnefo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
synnefo
Commits
4b6f82fb
Commit
4b6f82fb
authored
Sep 16, 2014
by
Ilias Tsitsimpis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
astakosclient: Use 'repr' when logging
Use 'repr' instead of 'str' when logging the response body.
parent
6d053a46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
astakosclient/astakosclient/__init__.py
astakosclient/astakosclient/__init__.py
+7
-7
No files found.
astakosclient/astakosclient/__init__.py
View file @
4b6f82fb
...
...
@@ -245,7 +245,7 @@ class AstakosClient(object):
hashed_token
.
update
(
self
.
token
)
self
.
logger
.
debug
(
"Make a
%
s request to
%
s, using token with hash
%
s, "
"with headers
%
s and body
%
s
"
,
"with headers
%
r and body
%
r
"
,
method
,
request_path
,
hashed_token
.
hexdigest
(),
headers
,
body
if
log_body
else
"(not logged)"
)
...
...
@@ -287,11 +287,11 @@ class AstakosClient(object):
self
.
log_response
=
dict
(
status
=
status
,
message
=
message
,
data
=
data
)
except
Exception
as
err
:
self
.
logger
.
error
(
"Failed to send request:
%
s"
%
repr
(
err
)
)
self
.
logger
.
error
(
"Failed to send request:
%
r"
,
err
)
raise
ConnectionError
(
err
)
# Return
self
.
logger
.
debug
(
"Request returned with status
%
s"
%
status
)
self
.
logger
.
debug
(
"Request returned with status
%
s"
,
status
)
if
status
==
400
:
raise
BadRequest
(
message
,
data
)
elif
status
==
401
:
...
...
@@ -309,7 +309,7 @@ class AstakosClient(object):
else
:
return
None
except
Exception
as
err
:
msg
=
"Cannot parse response
\"
%
s
\"
with simplejson:
%
s"
msg
=
"Cannot parse response
\"
%
r
\"
with simplejson:
%
s"
self
.
logger
.
error
(
msg
%
(
data
,
str
(
err
)))
raise
InvalidResponse
(
str
(
err
),
data
)
...
...
@@ -325,7 +325,7 @@ class AstakosClient(object):
if
"uuid_catalog"
in
data
:
return
data
.
get
(
"uuid_catalog"
)
else
:
msg
=
"_uuid_catalog request returned
%
s
. No uuid_catalog found"
\
msg
=
"_uuid_catalog request returned
%
r
. No uuid_catalog found"
\
%
data
self
.
logger
.
error
(
msg
)
raise
AstakosClientException
(
msg
)
...
...
@@ -376,7 +376,7 @@ class AstakosClient(object):
if
"displayname_catalog"
in
data
:
return
data
.
get
(
"displayname_catalog"
)
else
:
msg
=
"_displayname_catalog request returned
%
s
. "
\
msg
=
"_displayname_catalog request returned
%
r
. "
\
"No displayname_catalog found"
%
data
self
.
logger
.
error
(
msg
)
raise
AstakosClientException
(
msg
)
...
...
@@ -608,7 +608,7 @@ class AstakosClient(object):
if
"serial"
in
response
:
return
response
[
'serial'
]
else
:
msg
=
"issue_commission_core request returned
%
s
. "
+
\
msg
=
"issue_commission_core request returned
%
r
. "
+
\
"No serial found"
%
response
self
.
logger
.
error
(
msg
)
raise
AstakosClientException
(
msg
)
...
...
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