X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=juju%2Fmodel.py;h=548fc03526d6b572ab8f2343ec4a451f937f9cf8;hb=01ab1abd39c3a8dda2dc99745e782e840c7f5b10;hp=1177f001cf981b5da8938a20eaa85731debd485e;hpb=ca170102476524e17c37d2efac3ce60f6ac6f326;p=osm%2FN2VC.git diff --git a/juju/model.py b/juju/model.py index 1177f00..548fc03 100644 --- a/juju/model.py +++ b/juju/model.py @@ -1042,10 +1042,7 @@ class Model(object): ) app.placement = placement - result = await app_facade.Deploy([app]) - errors = [r.error.message for r in result.results if r.error] - if errors: - raise JujuError('\n'.join(errors)) + await app_facade.Deploy([app]) return await self._wait_for_new('application', application_name) def destroy(self): @@ -1512,9 +1509,6 @@ class BundleHandler(object): self.plan = await self.client_facade.GetBundleChanges( yaml.dump(self.bundle)) - if self.plan.errors: - raise JujuError('\n'.join(self.plan.errors)) - async def execute_plan(self): for step in self.plan.changes: method = getattr(self, step.method) @@ -1650,14 +1644,18 @@ class BundleHandler(object): """ # resolve indirect references charm = self.resolve(charm) - # stringify all config values for API + # stringify all config values for API, and convert to YAML options = {k: str(v) for k, v in options.items()} + options = yaml.dump({application: options}, default_flow_style=False) # build param object app = client.ApplicationDeploy( charm_url=charm, series=series, application=application, - config=options, + # Pass options to config-yaml rather than config, as + # config-yaml invokes a newer codepath that better handles + # empty strings in the options values. + config_yaml=options, constraints=parse_constraints(constraints), storage=storage, endpoint_bindings=endpoint_bindings,