~free.ekanayaka/landscape-client/jaunty-1.5.0-0ubuntu0.9.04.0

« back to all changes in this revision

Viewing changes to landscape/broker/transport.py

  • Committer: Bazaar Package Importer
  • Author(s): Free Ekanayaka
  • Date: 2010-02-10 18:41:52 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100210184152-nwym7cw17mqm17qo
Tags: 1.4.4-0ubuntu0.9.04
* New upstream release (LP: #519200):
  - Add a message for creating package locks (LP: #514334)
  - Add support for auto-approved change-packages messages (LP: #517175)
  - Add support for installing server-generated debian packages (LP: #509752)
  - Add support for reporting Eucalyptus topology information (LP: #518501)
  - Fix timeout while inserting large free-space message (LP: #218388)
  - Fix wrong log path in motd (LP: #517454)
  - Fix race condition in process excecution (LP: #517453)

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
from landscape.lib.fetch import fetch
9
9
from landscape.lib import bpickle
10
10
from landscape.log import format_delta
11
 
from landscape import API, VERSION
 
11
from landscape import SERVER_API, VERSION
12
12
 
13
13
 
14
14
class HTTPTransport(object):
17
17
    def __init__(self, url, pubkey=None):
18
18
        """
19
19
        @param url: URL of the remote Landscape server message system.
20
 
        @param pubkey: SSH pubblic key used for secure communication.
 
20
        @param pubkey: SSH public key used for secure communication.
21
21
        """
22
22
        self._url = url
23
23
        self._pubkey = pubkey
40
40
        return (curl, fetch(self._url, post=True, data=payload,
41
41
                            headers=headers, cainfo=self._pubkey, curl=curl))
42
42
 
43
 
    def exchange(self, payload, computer_id=None, message_api=API):
 
43
    def exchange(self, payload, computer_id=None, message_api=SERVER_API):
44
44
        """Exchange message data with the server.
45
45
 
46
46
        @param payload: The object to send, it must be L{bpickle}-compatible.
105
105
    def set_url(self, url):
106
106
        self._url = url
107
107
 
108
 
    def exchange(self, payload, computer_id=None, message_api=API):
 
108
    def exchange(self, payload, computer_id=None, message_api=SERVER_API):
109
109
        self.payloads.append(payload)
110
110
        self.computer_id = computer_id
111
111
        self.message_api = message_api