Skip to content

Commit fb617b6

Browse files
committed
Revise the upgrade local charm to use the GetCharmURLOrigin
instead of passing channel to the SetCharm
1 parent 4d18b7d commit fb617b6

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

juju/application.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,6 @@ async def refresh(
633633
:param str switch: Crossgrade charm url
634634
635635
"""
636-
if path is not None:
637-
await self.local_refresh(channel, force, force_series, force_units,
638-
path, resources)
639-
return
640636
if resources is not None:
641637
raise NotImplementedError("resources option is not implemented")
642638

@@ -659,6 +655,11 @@ async def refresh(
659655
charm_url = switch or charm_url_origin_result.url
660656
origin = charm_url_origin_result.charm_origin
661657

658+
if path is not None:
659+
await self.local_refresh(origin, force, force_series,
660+
force_units, path, resources)
661+
return
662+
662663
parsed_url = URL.parse(charm_url)
663664
charm_name = parsed_url.name
664665

@@ -788,7 +789,8 @@ async def refresh(
788789
upgrade_charm = refresh
789790

790791
async def local_refresh(
791-
self, channel=None, force=False, force_series=False, force_units=False,
792+
self, charm_origin=None, force=False, force_series=False,
793+
force_units=False,
792794
path=None, resources=None):
793795
"""Refresh the charm for this application with a local charm.
794796
@@ -831,7 +833,7 @@ async def local_refresh(
831833
# Update application
832834
await app_facade.SetCharm(
833835
application=self.entity_id,
834-
channel=channel,
836+
charm_origin=charm_origin,
835837
charm_url=charm_url,
836838
config_settings=None,
837839
config_settings_yaml=None,

0 commit comments

Comments
 (0)