support zipped plugins
Bug #1866907 reported by
Paul Collins
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Grafana Charm |
Fix Released
|
Wishlist
|
Liam Young |
Bug Description
It seems to be fairly common to distribute Grafana plugins as zip files (e.g. https:/
The charm doesn't support zip files:
2020-03-10 20:09:50 INFO config-changed shutil.ReadError: /tmp/grafana-
So we have to repack them first. It would be good to eliminate this step.
Related branches
~gnuoy/charm-grafana:bug/1866907
- BootStack Reviewers: Pending requested
-
Diff: 24 lines (+4/-8)1 file modifiedsrc/reactive/grafana.py (+4/-8)
Changed in charm-grafana: | |
importance: | Undecided → Wishlist |
Changed in charm-grafana: | |
status: | New → Confirmed |
assignee: | nobody → Liam Young (gnuoy) |
Changed in charm-grafana: | |
status: | Confirmed → Fix Released |
milestone: | none → 21.07 |
To post a comment you must log in.
Looks like this is because the charm always writes the file to /tmp/grafana- plugin. tar.gz (unsafe usage of /tmp there!) and shutil. unpack_ archive guesses based on the filename.
-----
2020-03-10 20:09:50 INFO config-changed File "/var/lib/ juju/agents/ unit-grafana- 0/.venv/ lib/python3. 4/site- packages/ charms/ reactive/ bus.py" , line 181, in invoke juju/agents/ unit-grafana- 0/charm/ reactive/ grafana. py", line 183, in install_plugins unpack_ archive( plugin_ file, plugins_dir) juju/agents/ unit-grafana- 0/.venv/ lib/python3. 4/shutil. py", line 961, in unpack_archive juju/agents/ unit-grafana- 0/.venv/ lib/python3. 4/shutil. py", line 904, in _unpack_tarfile plugin. tar.gz is not a compressed or uncompressed tar file
2020-03-10 20:09:50 INFO config-changed self._action(*args)
2020-03-10 20:09:50 INFO config-changed File "/var/lib/
2020-03-10 20:09:50 INFO config-changed shutil.
2020-03-10 20:09:50 INFO config-changed File "/var/lib/
2020-03-10 20:09:50 INFO config-changed func(filename, extract_dir, **kwargs)
2020-03-10 20:09:50 INFO config-changed File "/var/lib/
2020-03-10 20:09:50 INFO config-changed "%s is not a compressed or uncompressed tar file" % filename)
2020-03-10 20:09:50 INFO config-changed shutil.ReadError: /tmp/grafana-
-----
Help on function unpack_archive in module shutil:
unpack_ archive( filename, extract_dir=None, format=None)
[...]
`format` is the archive format: one of "zip", "tar", "gztar", "bztar",
or "xztar". Or any other registered format. If not provided,
unpack_archive will use the filename extension and see if an unpacker
was registered for that extension.
[...]