Skip to content

Commit 3f33aa4

Browse files
committed
Local refresh is indeed implemented
fixes #756
1 parent 9812e91 commit 3f33aa4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

juju/application.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,14 +637,11 @@ async def refresh(
637637
:param str switch: Crossgrade charm url
638638
639639
"""
640-
if resources is not None:
641-
raise NotImplementedError("resources option is not implemented")
642640

643641
if switch is not None and revision is not None:
644642
raise ValueError("switch and revision are mutually exclusive")
645643

646644
app_facade = self._facade()
647-
resources_facade = client.ResourcesFacade.from_connection(self.connection)
648645
charms_facade = client.CharmsFacade.from_connection(self.connection)
649646

650647
# 1 - Figure out the destination origin and destination charm_url
@@ -664,6 +661,9 @@ async def refresh(
664661
force_units, path, resources)
665662
return
666663

664+
if resources is not None:
665+
raise NotImplementedError("resources option is not implemented")
666+
667667
parsed_url = URL.parse(charm_url)
668668
charm_name = parsed_url.name
669669

@@ -731,6 +731,7 @@ async def refresh(
731731
# Already prepped the charm_resources
732732
# Now get the existing resources from the ResourcesFacade
733733
request_data = [client.Entity(self.tag)]
734+
resources_facade = client.ResourcesFacade.from_connection(self.connection)
734735
response = await resources_facade.ListResources(entities=request_data)
735736
existing_resources = {
736737
resource.name: resource

0 commit comments

Comments
 (0)