apply-config-changes=True on bundle phases crashes mojo

Bug #1906401 reported by Daniel Manrique on 2020-12-01
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mojo: Continuous Delivery for Juju

Bug Description

2020-12-01 13:48:27 [INFO] Applying config changes, if any.
2020-12-01 13:48:27 [ERROR] Unknown error
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mojo/", line 684, in run_with_args
  File "/usr/lib/python3/dist-packages/mojo/", line 380, in wrapped
    return method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/mojo/", line 352, in run_from_manifest, workspace, args.stage, args.interactive)
  File "/usr/lib/python3/dist-packages/mojo/", line 126, in run, workspace, stage)
  File "/usr/lib/python3/dist-packages/mojo/", line 902, in run
    diff_processor=lambda d: process_config_changes_from_diff(d, preview=False),
TypeError: diff() got an unexpected keyword argument 'diff_processor'

This happens when apply-config-changes=True is specified on a bundle line/phase, example:

bundle config=services apply-config-changes=True local=secrets delay=0 additional-ready-states=waiting

and the reason is because apply-config-changes=True tries to produce a diff to figure out which changes to apply. For a deploy phase this is done with juju-deployer's --diff option, but bundle phases don't have an equivalent (juju bundle deploying doesn't support diff directly) - and indeed the diff method of BundlePhase does not support the required diff_processor parameter.

That said, per Mojo's readme, apply-config-changes is ineffectual in bundle phases, as bundles always apply config changes.

Looks to me like ignoring apply-config-changes on bundle phases, or exiting with a nice error message rather than crashing unscrutably, would be better behaviors. I think ignoring it would be friendlier as it wouldn't abort a potentially long-running mojo run for a non-reason, and ignoring it will still do what the user intended (applying config changes).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers