Merge pull request #23 from petevg/bug/instance-placement-bug
authorTim Van Steenburgh <tvansteenburgh@gmail.com>
Tue, 29 Nov 2016 15:09:30 +0000 (10:09 -0500)
committerGitHub <noreply@github.com>
Tue, 29 Nov 2016 15:09:30 +0000 (10:09 -0500)
Added Placement parser.

1  2 
juju/application.py

diff --combined juju/application.py
@@@ -3,6 -3,7 +3,7 @@@ import loggin
  
  from . import model
  from .client import client
+ from .placement import parse as parse_placement
  
  log = logging.getLogger(__name__)
  
@@@ -49,10 -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.
  
@@@ -87,7 -84,7 +88,7 @@@
  
          result = await app_facade.AddUnits(
              application=self.name,
-             placement=to,
+             placement=[parse_placement(to)],
              num_units=count,
          )
  
  
          """
          pass
 +
 +    async def get_metrics(self):
 +        return await self.model.get_metrics(self.tag)