kolla-ansible/tests/link-module-utils.sh
Michal Arbet 63b9fa5639 Fix kolla_docker module
This patch fixes kolla_docker module
as it did not take into account common_options
parameter. From patchset it's visible that module's
default values are used always - even if user overrided
some param in common_options dict.

Closes-Bug: #2003079

Change-Id: I677fde708dd004decaff4bd39f2173d8d81052fb
2023-02-04 23:54:47 +01:00

18 lines
663 B
Bash
Executable File

#!/usr/bin/env bash
# NOTE(hinermar): During deployment, Ansible handles module discovery
# automatically. In testing environment this feature is
# not present so it's necessary to link module files to environment
# package directory so they can be discovered by python interpreter.
local_module_utils=${1}/ansible/module_utils
env_module_utils=$(/usr/bin/env python -c "import ansible; print(ansible.__path__[0] + '/module_utils')")
for file_path in ${local_module_utils}/*.py; do
file_name=$(basename ${file_path})
source=$(realpath ${file_path})
destination=$(realpath ${env_module_utils})/${file_name}
ln -fs ${source} ${destination}
done