From 224a14c0bbd6b0a621a24ae889fea9279755a57b Mon Sep 17 00:00:00 2001 From: Tim Van Steenburgh Date: Tue, 18 Oct 2016 08:14:39 -0400 Subject: [PATCH] Move expose() logic to Application --- juju/application.py | 10 ++++++++-- juju/model.py | 4 +--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/juju/application.py b/juju/application.py index 1e87ced..53f584a 100644 --- a/juju/application.py +++ b/juju/application.py @@ -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. diff --git a/juju/model.py b/juju/model.py index 1ed5ecd..ab9f712 100644 --- a/juju/model.py +++ b/juju/model.py @@ -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): """ -- 2.25.1