~frankban/charms/precise/juju-gui/deployer-unit-errors

« back to all changes in this revision

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

  • Committer: Francesco Banconi
  • Date: 2014-02-20 13:08:59 UTC
  • mfrom: (164.1.3 deployer-unit-errors-proto)
  • Revision ID: francesco.banconi@canonical.com-20140220130859-qtf8bf0jkc1w68hx
New deployer v0.3.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    ProcessPoolExecutor,
31
31
)
32
32
from deployer import guiserver as blocking
33
 
import deployer.cli
34
33
from tornado import gen
35
34
from tornado.ioloop import IOLoop
36
35
from tornado.util import ObjectDict
50
49
# Juju API versions supported by the GUI server Deployer.
51
50
# Tests use the first API version in this list.
52
51
SUPPORTED_API_VERSIONS = ['go']
53
 
# Options used by the juju-deployer.  The defaults work for us.
54
 
IMPORTER_OPTIONS = deployer.cli.setup_parser().parse_args([])
55
52
 
56
53
 
57
54
class Deployer(object):
96
93
        # The futures attribute maps deployment identifiers to Futures.
97
94
        self._futures = {}
98
95
 
 
96
        # Options used by the juju-deployer.
 
97
        self.importer_options = blocking.get_default_guiserver_options()
 
98
 
99
99
    @gen.coroutine
100
100
    def validate(self, user, name, bundle):
101
101
        """Validate the deployment bundle.
149
149
        # to be called when the import process completes.
150
150
        future = self._run_executor.submit(
151
151
            blocking.import_bundle,
152
 
            self._apiurl, user.password, name, bundle, IMPORTER_OPTIONS)
 
152
            self._apiurl, user.password, name, bundle, self.importer_options)
153
153
        add_future(self._io_loop, future, self._import_callback,
154
154
                   deployment_id, bundle_id)
155
155
        self._futures[deployment_id] = future