~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/codehosting/smartserver.py

  • Committer: Aaron Bentley
  • Date: 2008-01-21 05:44:15 UTC
  • mto: This revision was merged to the branch mainline in revision 5586.
  • Revision ID: aaron@canonical.com-20080121054415-zjklfqnpbqe25v81
Quicksave

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
__metaclass__ = type
6
6
__all__ = [
7
 
    'ExecOnlySession', 'RestrictedExecOnlySession', 'get_bzr_path',
8
 
    'launch_smart_server']
 
7
    'ExecOnlySession', 'RestrictedExecOnlySession', 'launch_smart_server']
9
8
 
10
9
import os
11
10
import urlparse
17
16
from twisted.python import log
18
17
 
19
18
from canonical.config import config
20
 
from canonical.codehosting import get_bzr_path, get_bzr_plugins_path
 
19
from canonical.codehosting import get_bzr_path
21
20
 
22
21
 
23
22
class ForbiddenCommand(Exception):
69
68
            protocol.write(str(e) + '\r\n')
70
69
            protocol.loseConnection()
71
70
            raise
 
71
        sorted_environment = sorted(self.environment.items())
72
72
        log.msg('Running: %r, %r, %r'
73
 
                % (executable, arguments, self.environment))
 
73
                % (executable, arguments, sorted_environment))
74
74
        self._transport = self.reactor.spawnProcess(
75
75
            protocol, executable, arguments, env=self.environment)
76
76
 
147
147
        % {'python': sys.executable, 'bzr': get_bzr_path()})
148
148
 
149
149
    environment = dict(os.environ)
150
 
    environment['BZR_PLUGIN_PATH'] = get_bzr_plugins_path()
151
150
 
152
151
    # Extract the hostname from the supermirror root config.
153
152
    hostname = urlparse.urlparse(config.codehosting.supermirror_root)[1]