Using tarfile lib instead of subprocess
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EasyRSA Charm |
New
|
Undecided
|
Unassigned |
Bug Description
Easyrsa charm uses subprocess to execute "tar" executable on couple of places in the reactive layer. This can be replaced with usage of a builtin `tarfile` library.
1. In the install() function, subprocess is used to unpack easyrsa tarball resource [1]
2.In the get_version() function subprocess is used to list contents of the easyrsa tarball resource [2]
In addition, the get_version() function could use some sanity checks to ensure that easyrsa tarball (and its contents) have expected structure and naming. As it stands now, the function can raise KeyErrors or report values that are not actually an EasyRSA version.
---
[1] https:/
[2] https:/