The latest mojo build seems to have regressed and can no longer deploy-diff:
$ mojo deploy-diff --apply-config-changes
2020-06-18 09:25:54 [INFO] Using pre-existing container class lxc
2020-06-18 09:25:54 [INFO] Rsyncing /home/stg-foo/spec to /srv/mojo/mojo-foo/bionic/staging/spec
2020-06-18 09:25:56 [INFO] Applying config changes, if any.
2020-06-18 09:25:56 [INFO] Pulling secrets from /srv/mojo/LOCAL/mojo-foo/staging to /srv/mojo/mojo-foo/bionic/staging/local
2020-06-18 09:25:58 Application: telegraf will show ambiguous relations to foo
2020-06-18 09:25:58 Application: telegraf will show ambiguous relations to foo
2020-06-18 09:25:58 Application: foo will show ambiguous relations to telegraf
2020-06-18 09:25:58 Application: foo will show ambiguous relations to telegraf
2020-06-18 09:25:58 [ERROR] Unknown error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/mojo/cli.py", line 684, in run_with_args
args.func(args)
File "/usr/lib/python3/dist-packages/mojo/cli.py", line 73, in diff_deploy
phase.diff(project, workspace, args.stage)
File "/usr/lib/python3/dist-packages/mojo/phase.py", line 945, in run
self, project, workspace, stage, diff_processor=lambda d: process_config_changes_from_diff(d, preview=False)
File "/usr/lib/python3/dist-packages/mojo/phase.py", line 781, in diff
diff_processor(diff)
File "/usr/lib/python3/dist-packages/mojo/phase.py", line 945, in <lambda>
self, project, workspace, stage, diff_processor=lambda d: process_config_changes_from_diff(d, preview=False)
File "/usr/lib/python3/dist-packages/mojo/phase.py", line 496, in process_config_changes_from_diff
if identical_but_wrapped_in_newlines(changes["env-config"][config_item], config_value):
File "/usr/lib/python3/dist-packages/mojo/phase.py", line 463, in identical_but_wrapped_in_newlines
return current == proposed.strip("\n")
TypeError: 'str' does not support the buffer interface
$
The traceback means that proposed is a bytestring, and you can't strip the unicode string "\n" from it. Either proposed should be a unicode string and the bug is whatever made it not be that, or .strip("\n") needs to become .strip(b"\n").
Python 3.8.2 (default, Apr 27 2020, 15:53:34)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> " ".strip("hello")
' '
>>> b' '.strip("hello")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: a bytes-like object is required, not 'str'
>>>