Skip to content

Commit

Permalink
Clean up the code for adding charm
Browse files Browse the repository at this point in the history
The readability of some of the if statements was slightly hard to
comprehend because of the if, elif statements.
  • Loading branch information
SimonRichardson committed May 19, 2021
1 parent 0e901f8 commit 749f140
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions juju/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,14 +576,14 @@ async def run(self, context):
context.origins[self.charm] = {str(None): origin}
return self.charm

elif Schema.CHARM_STORE.matches(url.schema):
if Schema.CHARM_STORE.matches(url.schema):
entity_id = await context.charmstore.entityId(self.charm)
log.debug('Adding %s', entity_id)
await context.client_facade.AddCharm(channel=None, url=entity_id, force=False)
identifier = entity_id
origin = client.CharmOrigin(source="charm-store", risk="stable")

elif Schema.CHARM_HUB.matches(url.schema):
if Schema.CHARM_HUB.matches(url.schema):
ch = Channel('latest', 'stable')
if self.channel:
ch = Channel.parse(self.channel).normalize()
Expand Down

0 comments on commit 749f140

Please sign in to comment.