X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=juju%2Fmodel.py;h=6eb4e9fe1a0b6f06294d8046d540ac22f1cc3189;hb=98e277e099c01117cfb694e25746d8900649b3e3;hp=e3a6fea6e3c0299a5c0affe9edcad74627e43279;hpb=b7e54690262eb1021274aabb8e93188e49508150;p=osm%2FN2VC.git diff --git a/juju/model.py b/juju/model.py index e3a6fea..6eb4e9f 100644 --- a/juju/model.py +++ b/juju/model.py @@ -977,6 +977,18 @@ class Model(object): if not is_local: await client_facade.AddCharm(channel, entity_id) + elif not entity_id.startswith('local:'): + # We have a local charm dir that needs to be uploaded + charm_dir = os.path.abspath( + os.path.expanduser(entity_id)) + series = series or get_charm_series(charm_dir) + if not series: + raise JujuError( + "Couldn't determine series for charm at {}. " + "Pass a 'series' kwarg to Model.deploy().".format( + charm_dir)) + entity_id = await self.add_local_charm_dir(charm_dir, series) + app = client.ApplicationDeploy( application=application_name, channel=channel, @@ -1438,7 +1450,7 @@ class BundleHandler(object): # If we have apps to update, spawn all the coroutines concurrently # and wait for them to finish. charm_urls = await asyncio.gather(*[ - asyncio.ensure_future(self.model.add_local_charm_dir(*params)) + self.model.add_local_charm_dir(*params) for params in args ]) # Update the 'charm:' entry for each app with the new 'local:' url.