~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/userservice/__init__.py

  • Committer: William Grant
  • Date: 2009-04-28 05:28:11 UTC
  • Revision ID: grantw@unimelb.edu.au-20090428052811-iymibe324fnk93z6
Use the config from the request, rather than ivle.conf, in userservice.

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
 
140
140
import ivle.database
141
141
from ivle import (util, chat)
142
 
from ivle.conf import (usrmgt_host, usrmgt_port, usrmgt_magic)
143
142
from ivle.webapp.security import get_user_details
144
143
import ivle.pulldown_subj
145
144
 
249
248
 
250
249
    # Try and contact the usrmgt server
251
250
    try:
252
 
        response = chat.chat(usrmgt_host, usrmgt_port, msg, usrmgt_magic)
 
251
        response = chat.chat(req.config['usrmgt']['host'],
 
252
                             req.config['usrmgt']['port'],
 
253
                             msg,
 
254
                             req.config['usrmgt']['magic'],
 
255
                            )
253
256
    except cjson.DecodeError:
254
257
        # Gave back rubbish - set the response to failure
255
258
        response = {'response': 'usrmgt-failure'}
564
567
 
565
568
    # Contact the usrmgt server
566
569
    try:
567
 
        usrmgt = chat.chat(usrmgt_host, usrmgt_port, msg, usrmgt_magic)
 
570
        usrmgt = chat.chat(req.config['usrmgt']['host'],
 
571
                           req.config['usrmgt']['port'],
 
572
                           msg,
 
573
                           req.config['usrmgt']['magic'],
 
574
                          )
568
575
    except cjson.DecodeError, e:
569
576
        raise Exception("Could not understand usrmgt server response:" +
570
577
                        e.message)
649
656
    # Contact the usrmgt server
650
657
    msg = {'rebuild_svn_group_config': {}}
651
658
    try:
652
 
        usrmgt = chat.chat(usrmgt_host, usrmgt_port, msg, usrmgt_magic)
 
659
        usrmgt = chat.chat(req.config['usrmgt']['host'],
 
660
                           req.config['usrmgt']['port'],
 
661
                           msg,
 
662
                           req.config['usrmgt']['magic'],
 
663
                          )
653
664
    except cjson.DecodeError, e:
654
665
        raise Exception("Could not understand usrmgt server response: %s" +
655
666
                        e.message)
689
700
    # Contact the usrmgt server
690
701
    msg = {'rebuild_svn_group_config': {}}
691
702
    try:
692
 
        usrmgt = chat.chat(usrmgt_host, usrmgt_port, msg, usrmgt_magic)
 
703
        usrmgt = chat.chat(req.config['usrmgt']['host'],
 
704
                           req.config['usrmgt']['port'],
 
705
                           msg,
 
706
                           req.config['usrmgt']['magic'],
 
707
                          )
693
708
    except cjson.DecodeError, e:
694
709
        raise Exception("Could not understand usrmgt server response: %s" +
695
710
                        e.message)