Skip to content

Commit e2e60ae

Browse files
committed
Pass through local_refresh if refreshing with local charm & resources
This patches a bug that 5d843ec introduced, where if --path is given (refreshing with a local charm), it errors with NYI if --resources is given (instead of falling through the local_refresh). Should fix #881
1 parent 36d078b commit e2e60ae

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

juju/application.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ async def set_constraints(self, constraints):
623623

624624
async def refresh(
625625
self, channel=None, force=False, force_series=False, force_units=False,
626-
path=None, resources=None, revision=None, switch=None):
626+
local_charm_path=None, resources=None, revision=None, switch=None):
627627
"""Refresh the charm for this application.
628628
629629
:param str channel: Channel to use when getting the charm from the
@@ -632,17 +632,17 @@ async def refresh(
632632
application is not supported by the new charm
633633
:param bool force_units: Refresh all units immediately, even if in
634634
error state
635-
:param str path: Refresh to a charm located at path
635+
:param str local_charm_path: Refresh to a charm located at path
636636
:param dict resources: Dictionary of resource name/filepath pairs
637637
:param int revision: Explicit refresh revision
638638
:param str switch: Crossgrade charm url
639639
640640
"""
641-
if resources is not None:
642-
raise NotImplementedError("resources option is not implemented")
641+
if local_charm_path is None and resources is not None:
642+
raise NotImplementedError("refreshing a non-local charm with resources option is not yet implemented")
643643

644644
if switch is not None and revision is not None:
645-
raise ValueError("switch and revision are mutually exclusive")
645+
raise ValueError("switch and revision parameters are mutually exclusive in application refresh")
646646

647647
app_facade = self._facade()
648648
resources_facade = client.ResourcesFacade.from_connection(self.connection)
@@ -660,9 +660,9 @@ async def refresh(
660660
charm_url = switch or charm_url_origin_result.url
661661
origin = charm_url_origin_result.charm_origin
662662

663-
if path is not None:
663+
if local_charm_path is not None:
664664
await self.local_refresh(origin, force, force_series,
665-
force_units, path, resources)
665+
force_units, local_charm_path, resources)
666666
return
667667

668668
parsed_url = URL.parse(charm_url)

0 commit comments

Comments
 (0)