From: Tim Van Steenburgh Date: Tue, 18 Oct 2016 12:14:39 +0000 (-0400) Subject: Move expose() logic to Application X-Git-Tag: 0.1.0~71 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;ds=inline;h=224a14c0bbd6b0a621a24ae889fea9279755a57b;p=osm%2FN2VC.git Move expose() logic to Application --- 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): """