Merge pull request #43 from juju/feature/get-controller-cloud
[osm/N2VC.git] / juju / model.py
index ecd764b..c6c01f6 100644 (file)
@@ -931,7 +931,10 @@ class Model(object):
                 storage=storage,
             )
 
-            await app_facade.Deploy([app])
+            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))
             return await self._wait_for_new('application', application_name)
 
     def destroy(self):
@@ -952,7 +955,7 @@ class Model(object):
             's' if len(unit_names) == 1 else '',
             ' '.join(unit_names))
 
-        return await app_facade.Destroy(self.name)
+        return await app_facade.DestroyUnits(list(unit_names))
     destroy_units = destroy_unit
 
     def get_backup(self, archive_id):