summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/ansible/module_common_regex_regression.sh
blob: 4869f4f0bf7cf6c0900638a2c93a6f1dee383e9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash

# #74270 -- ensure we escape directory names before passing to re.compile()
# particularly in module_common.

set -eux

lib_path=$(python -c 'import os, ansible; print(os.path.dirname(os.path.dirname(ansible.__file__)))')
bad_dir="${OUTPUT_DIR}/ansi[ble"

mkdir "${bad_dir}"
cp -a "${lib_path}" "${bad_dir}"

PYTHONPATH="${bad_dir}/lib" ansible -m ping localhost -i ../../inventory "$@"
rm -rf "${bad_dir}"