~frankban/charms/trusty/juju-gui/jujubundlelib-018

« back to all changes in this revision

Viewing changes to server/guiserver/bundles/base.py

  • Committer: Madison Scott-Clary
  • Date: 2015-02-18 17:17:40 UTC
  • mfrom: (60.15.15 guiserver-v4bundle)
  • Revision ID: matthew.scott@canonical.com-20150218171740-tpdwiarn52i7t70g
Add support for v4 bundles

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
        self.importer_options = blocking.get_default_guiserver_options()
98
98
 
99
99
    @gen.coroutine
100
 
    def validate(self, user, name, bundle):
 
100
    def validate(self, user, bundle):
101
101
        """Validate the deployment bundle.
102
102
 
103
103
        The validation is executed in a separate process using the
105
105
 
106
106
        Three arguments are provided:
107
107
          - user: the current authenticated user;
108
 
          - name: then name of the bundle to be imported;
109
108
          - bundle: a YAML decoded object representing the bundle contents.
110
109
 
111
110
        Return a Future whose result is a string representing an error or None
272
271
        self._deployer = deployer
273
272
        self._write_response = write_response
274
273
        self.routes = {
 
274
            # Default import route
275
275
            'Import': views.import_bundle,
276
276
            'Watch': views.watch,
277
277
            'Next': views.next,
291
291
    def process_request(self, data):
292
292
        """Process a deployment request."""
293
293
        request_id = data['RequestId']
 
294
        params = data.get('Params', {})
294
295
        view = self.routes[data['Request']]
295
 
        request = ObjectDict(params=data.get('Params', {}), user=self._user)
 
296
        request = ObjectDict(params=params, user=self._user)
296
297
        response = yield view(request, self._deployer)
297
298
        response['RequestId'] = request_id
298
299
        self._write_response(response)