Move expose() logic to Application
authorTim Van Steenburgh <tvansteenburgh@gmail.com>
Tue, 18 Oct 2016 12:14:39 +0000 (08:14 -0400)
committerTim Van Steenburgh <tvansteenburgh@gmail.com>
Tue, 18 Oct 2016 12:14:39 +0000 (08:14 -0400)
juju/application.py
juju/model.py

index 1e87ced..53f584a 100644 (file)
@@ -107,11 +107,17 @@ class Application(model.ModelEntity):
         return await app_facade.Destroy(self.name)
     remove = destroy
 
-    def expose(self):
+    async def expose(self):
         """Make this service publicly available over the network.
 
         """
-        pass
+        app_facade = client.ApplicationFacade()
+        app_facade.connect(self.connection)
+
+        log.debug(
+            'Exposing %s', self.name)
+
+        return await app_facade.Expose(self.name)
 
     def get_config(self):
         """Return the configuration settings for this service.
index 1ed5ecd..ab9f712 100644 (file)
@@ -1313,9 +1313,7 @@ class BundleHandler(object):
             be exposed.
         """
         application = self.resolve(application)
-        log.debug('Exposing %s', application)
-        await self.app_facade.Expose(application)
-        return None
+        return await self.model.applications[application].expose()
 
     async def setAnnotations(self, id_, entity_type, annotations):
         """