Skip to content

Commit

Permalink
Merge pull request #356 from SimonRichardson/merge-forward
Browse files Browse the repository at this point in the history
#356

Making new changes in master (2.6) to 2.7 branch.
  • Loading branch information
jujubot committed Sep 5, 2019
2 parents 9b8ae4a + c4b0b51 commit f8d218a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions juju/bundle.py
Expand Up @@ -325,7 +325,7 @@ async def run(self, context):
charm_url=charm,
application=self.application,
series=self.series,
config=self.options,
config=options,
constraints=self.constraints,
endpoint_bindings=self.endpoint_bindings,
resources=resources,
Expand All @@ -337,10 +337,10 @@ async def run(self, context):

def __str__(self):
series = ""
if self.series != "":
if self.series is not None and self.series != "":
series = " on {}".format(self.series)
units_info = ""
if self.num_units > 0:
if self.num_units is not None:
plural = ""
if self.num_units > 1:
plural = "s"
Expand Down Expand Up @@ -413,7 +413,7 @@ async def run(self, context):
def __str__(self):
series = ""
channel = ""
if self.series != "":
if self.series is not None and self.series != "":
series = " for series {}".format(self.series)
if self.channel is not None:
channel = " from channel {}".format(self.channel)
Expand Down Expand Up @@ -681,9 +681,12 @@ async def run(self, context):
await context.model.create_offer(ep, offer_name=self.offer_name, application_name=application)

def __str__(self):
return "create offer {offer_name} using {application}:{endpoints}".format(offer_name=self.offer_name,
application=self.application,
endpoints=self.endpoints.join(","))
endpoints = ""
if self.endpoints is not None:
endpoints = ":{}".format(self.endpoints.join(","))
return "create offer {offer_name} using {application}{endpoints}".format(offer_name=self.offer_name,
application=self.application,
endpoints=endpoints)


class ConsumeOfferChange(ChangeInfo):
Expand Down

0 comments on commit f8d218a

Please sign in to comment.