Skip to content

Commit

Permalink
refactor: get_ostree_data.sh use env shebang - remove from .sanity*
Browse files Browse the repository at this point in the history
Use the `#!/usr/bin/env bash` shebang which is ansible-test friendly.
This means we can remove get_ostree_data.sh from the .sanity* files.
This also means we can remove the .sanity* files if we do not need
them otherwise.

Rename `pth` to `path` in honor of nscott

Signed-off-by: Rich Megginson <[email protected]>
  • Loading branch information
richm committed Dec 6, 2023
1 parent 844e1a9 commit 99dfb99
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .ostree/get_ostree_data.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand Down Expand Up @@ -28,7 +28,7 @@ if [ "$pkgtype" = testing ]; then
fi

get_rolepath() {
local ostree_dir role rolesdir roles_parent_dir coll_path pth
local ostree_dir role rolesdir roles_parent_dir coll_path path
ostree_dir="$1"
role="$2"
roles_parent_dir="$(dirname "$(dirname "$ostree_dir")")"
Expand All @@ -51,8 +51,8 @@ get_rolepath() {
coll_path="${ANSIBLE_COLLECTIONS_PATHS:-}"
fi
if [ -n "${coll_path}" ]; then
for pth in ${coll_path//:/ }; do
for rolesdir in "$pth"/ansible_collections/*/*_system_roles/roles/"$role"/.ostree; do
for path in ${coll_path//:/ }; do
for rolesdir in "$path"/ansible_collections/*/*_system_roles/roles/"$role"/.ostree; do
if [ -d "$rolesdir" ]; then
echo "$rolesdir"
return 0
Expand Down
1 change: 0 additions & 1 deletion .sanity-ansible-ignore-2.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ plugins/modules/kernel_settings.py validate-modules:missing-gplv3-license
plugins/modules/kernel_settings.py validate-modules:parameter-type-not-in-doc
plugins/modules/kernel_settings.py validate-modules:undocumented-parameter
plugins/modules/kernel_settings.py validate-modules:module-invalid-version-added
roles/kernel_settings/.ostree/get_ostree_data.sh shebang!skip
1 change: 0 additions & 1 deletion .sanity-ansible-ignore-2.11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ plugins/modules/kernel_settings.py validate-modules:missing-gplv3-license
plugins/modules/kernel_settings.py validate-modules:parameter-type-not-in-doc
plugins/modules/kernel_settings.py validate-modules:undocumented-parameter
plugins/modules/kernel_settings.py validate-modules:module-invalid-version-added
roles/kernel_settings/.ostree/get_ostree_data.sh shebang!skip
1 change: 0 additions & 1 deletion .sanity-ansible-ignore-2.12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ plugins/modules/kernel_settings.py validate-modules:missing-gplv3-license
plugins/modules/kernel_settings.py validate-modules:parameter-type-not-in-doc
plugins/modules/kernel_settings.py validate-modules:undocumented-parameter
plugins/modules/kernel_settings.py validate-modules:module-invalid-version-added
roles/kernel_settings/.ostree/get_ostree_data.sh shebang!skip
1 change: 0 additions & 1 deletion .sanity-ansible-ignore-2.13.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ plugins/modules/kernel_settings.py validate-modules:missing-gplv3-license
plugins/modules/kernel_settings.py validate-modules:parameter-type-not-in-doc
plugins/modules/kernel_settings.py validate-modules:undocumented-parameter
plugins/modules/kernel_settings.py validate-modules:module-invalid-version-added
roles/kernel_settings/.ostree/get_ostree_data.sh shebang!skip
1 change: 0 additions & 1 deletion .sanity-ansible-ignore-2.14.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ plugins/modules/kernel_settings.py validate-modules:missing-gplv3-license
plugins/modules/kernel_settings.py validate-modules:parameter-type-not-in-doc
plugins/modules/kernel_settings.py validate-modules:undocumented-parameter
plugins/modules/kernel_settings.py validate-modules:module-invalid-version-added
roles/kernel_settings/.ostree/get_ostree_data.sh shebang!skip
1 change: 0 additions & 1 deletion .sanity-ansible-ignore-2.15.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ plugins/modules/kernel_settings.py validate-modules:missing-gplv3-license
plugins/modules/kernel_settings.py validate-modules:parameter-type-not-in-doc
plugins/modules/kernel_settings.py validate-modules:undocumented-parameter
plugins/modules/kernel_settings.py validate-modules:module-invalid-version-added
roles/kernel_settings/.ostree/get_ostree_data.sh shebang!skip
1 change: 0 additions & 1 deletion .sanity-ansible-ignore-2.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ tests/kernel_settings/run_ansible_for_testing.sh shebang!skip
plugins/modules/kernel_settings.py validate-modules:missing-gplv3-license
plugins/modules/kernel_settings.py validate-modules:parameter-type-not-in-doc
plugins/modules/kernel_settings.py validate-modules:undocumented-parameter
roles/kernel_settings/.ostree/get_ostree_data.sh shebang!skip

0 comments on commit 99dfb99

Please sign in to comment.