Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
66c31fe2
Commit
66c31fe2
authored
Nov 01, 2012
by
John Jarvis
Committed by
Carlos Andrés Rocha
Nov 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding logging, reading sitename from settings
parent
84ff92d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
lms/djangoapps/certificates/queue.py
+15
-9
No files found.
lms/djangoapps/certificates/queue.py
View file @
66c31fe2
...
@@ -12,6 +12,10 @@ from student.models import UserProfile
...
@@ -12,6 +12,10 @@ from student.models import UserProfile
import
json
import
json
import
random
import
random
import
logging
logger
=
logging
.
getLogger
(
__name__
)
class
XQueueCertInterface
(
object
):
class
XQueueCertInterface
(
object
):
...
@@ -79,12 +83,14 @@ class XQueueCertInterface(object):
...
@@ -79,12 +83,14 @@ class XQueueCertInterface(object):
}
}
key
=
cert
.
key
key
=
cert
.
key
# TODO - this needs to be read from settings
xheader
=
make_xheader
(
xheader
=
make_xheader
(
'http://
sandbox-jrjarvis-001.m.edx.org/certificate'
,
'http://
{0}/certificate'
.
format
(
settings
.
SITE_NAME
)
,
key
,
'test-pull'
)
key
,
'test-pull'
)
(
error
,
msg
)
=
self
.
xqueue_interface
.
send_to_queue
(
header
=
xheader
,
(
error
,
msg
)
=
self
.
xqueue_interface
.
send_to_queue
(
body
=
json
.
dumps
(
contents
))
header
=
xheader
,
body
=
json
.
dumps
(
contents
))
if
error
:
logger
.
critical
(
'Unable to add a request to the queue'
)
raise
Exception
(
'Unable to send queue message'
)
return
cert_status
return
cert_status
...
@@ -125,9 +131,8 @@ class XQueueCertInterface(object):
...
@@ -125,9 +131,8 @@ class XQueueCertInterface(object):
}
}
key
=
cert
.
key
key
=
cert
.
key
# TODO - this needs to be read from settings
xheader
=
make_xheader
(
xheader
=
make_xheader
(
'http://
sandbox-jrjarvis-001.m.edx.org/certificate'
,
'http://
{0}/certificate'
.
format
(
settings
.
SITE_NAME
)
,
key
,
'test-pull'
)
key
,
'test-pull'
)
(
error
,
msg
)
=
self
.
xqueue_interface
.
send_to_queue
(
header
=
xheader
,
(
error
,
msg
)
=
self
.
xqueue_interface
.
send_to_queue
(
header
=
xheader
,
body
=
json
.
dumps
(
contents
))
body
=
json
.
dumps
(
contents
))
...
@@ -187,13 +192,14 @@ class XQueueCertInterface(object):
...
@@ -187,13 +192,14 @@ class XQueueCertInterface(object):
'course_id'
:
course_id
,
'course_id'
:
course_id
,
'name'
:
profile
.
name
,
'name'
:
profile
.
name
,
}
}
# TODO - this needs to be read from settings
xheader
=
make_xheader
(
xheader
=
make_xheader
(
'http://sandbox-jrjarvis-001.m.edx.org/'
'http://{0}/update_certificate?{1}'
.
format
(
'update_certificate?{0}'
.
format
(
key
),
key
,
'test-pull'
)
key
,
settings
.
SITE_NAME
),
key
,
'test-pull'
)
(
error
,
msg
)
=
self
.
xqueue_interface
.
send_to_queue
(
(
error
,
msg
)
=
self
.
xqueue_interface
.
send_to_queue
(
header
=
xheader
,
body
=
json
.
dumps
(
contents
))
header
=
xheader
,
body
=
json
.
dumps
(
contents
))
if
error
:
if
error
:
logger
.
critical
(
'Unable to post results to qserver'
)
raise
Exception
(
'Unable to send queue message'
)
raise
Exception
(
'Unable to send queue message'
)
return
cert_status
return
cert_status
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