addUnits no longer attempts to send [None] for `placement`.
[osm/N2VC.git] / juju / application.py
index df309b3..74f9057 100644 (file)
@@ -50,6 +50,10 @@ class Application(model.ModelEntity):
         """
         return self.data['status']['message']
 
+    @property
+    def tag(self):
+        return 'application-%s' % self.name
+
     async def add_relation(self, local_relation, remote_relation):
         """Add a relation to another application.
 
@@ -84,7 +88,7 @@ class Application(model.ModelEntity):
 
         result = await app_facade.AddUnits(
             application=self.name,
-            placement=[parse_placement(to)],
+            placement=[parse_placement(to)] if to else None,
             num_units=count,
         )
 
@@ -338,3 +342,6 @@ class Application(model.ModelEntity):
 
         """
         pass
+
+    async def get_metrics(self):
+        return await self.model.get_metrics(self.tag)