Skip to content

Commit 749f140

Browse files
Clean up the code for adding charm
The readability of some of the if statements was slightly hard to comprehend because of the if, elif statements.
1 parent 0e901f8 commit 749f140

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

juju/bundle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,14 +576,14 @@ async def run(self, context):
576576
context.origins[self.charm] = {str(None): origin}
577577
return self.charm
578578

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

586-
elif Schema.CHARM_HUB.matches(url.schema):
586+
if Schema.CHARM_HUB.matches(url.schema):
587587
ch = Channel('latest', 'stable')
588588
if self.channel:
589589
ch = Channel.parse(self.channel).normalize()

0 commit comments

Comments
 (0)