saltstack / saltstack/salt

[BUG] 3004RC1 zsh completions are not properly packaged

Open
#61,011 3 comments 0 reactions 1 assignee View on GitHub

@krionbsd is already working on this.

Since Oct 7, 2021.

bug tech-debt
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
Zsh completion was packaged as a part of #60392, but it's not properly packaged. There are two issues:

  1. The script name should be _salt instead of salt.zsh. I'm not sure if this is cosmetic or not.
  2. Near the end of the completion script there is:
salt_dir="${$(python2 -c 'import salt; print(salt.__file__);')%__init__*}"

Salt is currently being distributed as a Python 3 package, so Python 2 would just get an import error there and wouldn't print the installation path.

The only purpose of that line is to print out the path where Salt is installed, but that was intended as a generic solution for various types of installations.

For an RPM (or any other OS package) the packaging scripts know where Salt is going to be installed at package build time, so that line should be replaced with something like:

salt_dir="/usr/lib/python3.6/site-packages/salt"

Setup
Salt installation from an OS package (RPM, deb, etc.).

Steps to Reproduce the behavior
N/A

Expected behavior
Described above.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
# salt --versions-report
Salt Version:
          Salt: 3004rc1
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: Not Installed
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.11.1
       libgit2: Not Installed
      M2Crypto: 0.35.2
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: Not Installed
        pygit2: Not Installed
        Python: 3.6.8 (default, Nov 16 2020, 16:55:22)
  python-gnupg: Not Installed
        PyYAML: 3.13
         PyZMQ: 17.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.1.4
 
System Versions:
          dist: centos 7 Core
        locale: ISO-8859-2
       machine: x86_64
       release: 3.10.0-1160.42.2.el7.x86_64
        system: Linux
       version: CentOS Linux 7 Core

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.