Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
0978dd0d
Unverified
Commit
0978dd0d
authored
May 15, 2018
by
syed-awais-ali
Committed by
GitHub
May 15, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4559 from edx/aali/fix_script_python3
fixed json decoding
parents
ef8f4998
f7cae21d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
util/pingdom/create_pingdom_alerts.py
+5
-5
No files found.
util/pingdom/create_pingdom_alerts.py
View file @
0978dd0d
...
@@ -138,7 +138,7 @@ def create_check(pingdom_email, pingdom_password, pingdom_api_key, payload):
...
@@ -138,7 +138,7 @@ def create_check(pingdom_email, pingdom_password, pingdom_api_key, payload):
print_error_prefix
()
print_error_prefix
()
print_request_and_response
(
response
)
print_request_and_response
(
response
)
exit
(
1
)
exit
(
1
)
return
json
.
loads
(
response
.
content
)
return
json
.
loads
(
response
.
content
.
decode
(
'utf-8'
)
)
def
update_check
(
pingdom_email
,
pingdom_password
,
def
update_check
(
pingdom_email
,
pingdom_password
,
...
@@ -159,7 +159,7 @@ def update_check(pingdom_email, pingdom_password,
...
@@ -159,7 +159,7 @@ def update_check(pingdom_email, pingdom_password,
print_error_prefix
()
print_error_prefix
()
print_request_and_response
(
response
)
print_request_and_response
(
response
)
exit
(
1
)
exit
(
1
)
return
json
.
loads
(
response
.
content
)
return
json
.
loads
(
response
.
content
.
decode
(
'utf-8'
)
)
def
list_checks
(
pingdom_email
,
pingdom_password
,
pingdom_api_key
):
def
list_checks
(
pingdom_email
,
pingdom_password
,
pingdom_api_key
):
...
@@ -174,7 +174,7 @@ def list_checks(pingdom_email, pingdom_password, pingdom_api_key):
...
@@ -174,7 +174,7 @@ def list_checks(pingdom_email, pingdom_password, pingdom_api_key):
print_error_prefix
()
print_error_prefix
()
print_request_and_response
(
response
)
print_request_and_response
(
response
)
exit
(
1
)
exit
(
1
)
return
json
.
loads
(
response
.
content
)[
'checks'
]
return
json
.
loads
(
response
.
content
.
decode
(
'utf-8'
)
)[
'checks'
]
def
list_users
(
pingdom_email
,
pingdom_password
,
pingdom_api_key
):
def
list_users
(
pingdom_email
,
pingdom_password
,
pingdom_api_key
):
...
@@ -189,7 +189,7 @@ def list_users(pingdom_email, pingdom_password, pingdom_api_key):
...
@@ -189,7 +189,7 @@ def list_users(pingdom_email, pingdom_password, pingdom_api_key):
print_error_prefix
()
print_error_prefix
()
print_request_and_response
(
response
)
print_request_and_response
(
response
)
exit
(
1
)
exit
(
1
)
return
json
.
loads
(
response
.
content
)
return
json
.
loads
(
response
.
content
.
decode
(
'utf-8'
)
)
def
build_checks_by_hostname
(
pingdom_email
,
pingdom_password
,
pingdom_api_key
):
def
build_checks_by_hostname
(
pingdom_email
,
pingdom_password
,
pingdom_api_key
):
...
@@ -221,7 +221,7 @@ def print_request_and_response(response):
...
@@ -221,7 +221,7 @@ def print_request_and_response(response):
for
key
in
response
.
headers
:
for
key
in
response
.
headers
:
print
(
"{0}: {1}"
.
format
(
key
,
response
.
headers
[
key
]))
print
(
"{0}: {1}"
.
format
(
key
,
response
.
headers
[
key
]))
print
(
""
)
print
(
""
)
print
(
response
.
content
)
print
(
response
.
content
.
decode
(
'utf-8'
)
)
print
(
"------------------"
)
print
(
"------------------"
)
...
...
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