forked from saltstack/salt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bash-completion for Debian packages.
The file containing the completions was installed in the wrong directory (/usr/share/bash_completions/completions instead of /usr/share/bash_completion/completions) and symbolic links for salt-call, salt-cp, and salt-key were missing.
- Loading branch information
1 parent
a763096
commit be4bfbe
Showing
6 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fixed bash-completion in Debian / Ubuntu packages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pkg/common/salt.bash salt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
opt/saltstack/salt/salt-pip /usr/bin/salt-pip | ||
opt/saltstack/salt/salt-call /usr/bin/salt-call | ||
usr/share/bash-completion/completions/salt usr/share/bash-completion/completions/salt-call | ||
usr/share/bash-completion/completions/salt usr/share/bash-completion/completions/salt-cp | ||
usr/share/bash-completion/completions/salt usr/share/bash-completion/completions/salt-key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import pathlib | ||
|
||
|
||
def test_bash_completion_installed(grains): | ||
# This test specifically checks for a regression of #66560. | ||
if grains.get("os_family") == "Debian": | ||
completions_dir = pathlib.Path("/usr/share/bash-completion/completions") | ||
for exec_name in ("salt", "salt-call", "salt-cp", "salt-key"): | ||
# Bash-completion finds the completion when it is installed as | ||
# <command>, <command>.bash, or _<command>, so we test all three | ||
# variants before failing. | ||
completion_file1 = completions_dir / exec_name | ||
completion_file2 = completions_dir / f"{exec_name}.bash" | ||
completion_file3 = completions_dir / f"_{exec_name}" | ||
assert ( | ||
completion_file1.exists() | ||
or completion_file2.exists() | ||
or completion_file3.exists() | ||
) |