module

Krikri::PluginHelpers::MultiextSplit

MultiextSplit - the staged-filename split Ansible's fetch_file (ansible/module_utils/urls.py) applies to a URL basename before handing it to tempfile.NamedTemporaryFile: prefix, ext = _split_multiext(os.path.basename(urlparse(url).path), count=2)

  • the last two suffix components of 3-4 chars each become the tempfile's suffix, so helm-v3.3.0-linux-amd64.tar.gz stages as helm-v3.3.0-linux-amd64<rand8>.tar.gz. os.path.splitext would keep ".tar" in the prefix instead, and unarchive echoes the staged path back as src (verified against ansible-core 2.19.11), so the difference is visible in task output. Pure string logic, no I/O - own file so a spec can require it directly without triggering plugins/unarchive.cr's STDIN entry point (same shape as SystemdCliFlags).

Class methods

split(name : String) : Tuple(String, String)
Source