Charm upgrade appends ')' at the end of /usr/local/bin/auto_lint.py
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charm-juju-lint |
Fix Released
|
Undecided
|
Przemyslaw Lal |
Bug Description
After upgrading charm from stable (rev 1) to candidate (rev 2), juju unit enters "error" state with the following error printed out in the debug-log:
unit-juju-
File "/usr/local/
)
^
SyntaxError: unmatched ')'
unit-juju-
Traceback (most recent call last):
File "./src/charm.py", line 125, in <module>
main(
File "/var/lib/
_emit_
File "/var/lib/
event_
File "/var/lib/
framework.
File "/var/lib/
self.
File "/var/lib/
custom_
File "./src/charm.py", line 91, in on_config_changed
self.
File "/var/lib/
raise error
File "/var/lib/
subprocess.
File "/usr/lib/
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/
raise CalledProcessEr
subprocess.
unit-juju-
It turns out that charm upgrade adds an extra line (281):
279 if __name__ == "__main__":
280 main()
281 )
at the end of the script during upgrade which breaks the auto_lint.py script.
Related branches
- Xav Paice (community): Approve
- 🤖 prod-jenkaas-bootstack (community): Approve (continuous-integration)
- BootStack Reviewers: Pending requested
- BootStack Reviewers: Pending requested
-
Diff: 19 lines (+3/-3)1 file modifiedlib/lib_jujulint.py (+3/-3)
Changed in charm-juju-lint: | |
assignee: | nobody → Przemysław Lal (przemeklal) |
Changed in charm-juju-lint: | |
status: | In Progress → Fix Committed |
milestone: | none → 22.04 |
Changed in charm-juju-lint: | |
status: | Fix Committed → Fix Released |
Noteworthy - clean deployment of revision 2 works fine - no extra characters at the end of file.