Skip to content

Commit 0e20a99

Browse files
install openstack.cloud collection explicitly (#345)
install openstack.cloud collection explicitly Updated tests/utils scripts, install openstack.cloud collection explicitly. Reviewed-by: Anton Sidelnikov
1 parent 6a3b7b7 commit 0e20a99

5 files changed

Lines changed: 49 additions & 9 deletions

File tree

plugins/modules/anti_ddos_fip_statuses_info.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14+
1415
DOCUMENTATION = '''
1516
---
1617
module: anti_ddos_fip_statuses_info

plugins/modules/anti_ddos_optional_policies_info.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14+
1415
DOCUMENTATION = '''
1516
---
1617
module: anti_ddos_optional_policies_info

tests/utils/integration.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,21 @@ rsync -av . \
3030
"$TEST_DIR" > /dev/null|| true
3131

3232
if [ -f "requirements.txt" ]; then
33-
ansible-galaxy collection install -p "${ANSIBLE_COLLECTIONS_PATH}"
34-
ansible-galaxy role install -p "${ANSIBLE_COLLECTIONS_PATH}"
33+
ansible-galaxy collection install -r requirements.txt -p ${ANSIBLE_COLLECTIONS_PATH}
34+
ansible-galaxy role install -r requirements.txt -p ${ANSIBLE_COLLECTIONS_PATH}
35+
fi
36+
37+
# Initialize PYTHONPATH and ANSIBLE_COLLECTIONS_PATHS if not set
38+
export PYTHONPATH=${ANSIBLE_COLLECTIONS_PATH}:${PYTHONPATH:-""}
39+
export ANSIBLE_COLLECTIONS_PATHS=${ANSIBLE_COLLECTIONS_PATH}:${ANSIBLE_COLLECTIONS_PATHS:-""}
40+
41+
# Install the necessary openstack.cloud collection explicitly
42+
ansible-galaxy collection install openstack.cloud -f -p ${ANSIBLE_COLLECTIONS_PATH}
43+
44+
# Verify that the collection is installed
45+
if [ ! -d "${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud" ]; then
46+
echo "Error: openstack.cloud collection is not installed correctly."
47+
exit 1
3548
fi
3649

3750
cd "$TEST_DIR"

tests/utils/sanity.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,24 @@ rsync -av . \
1919
--exclude ci \
2020
--exclude .tox \
2121
--exclude .git \
22-
"$TEST_DIR" > /dev/null|| true
22+
"$TEST_DIR" > /dev/null || true
2323

2424
if [ -f "requirements.txt" ]; then
25-
ansible-galaxy collection install -p ${ANSIBLE_COLLECTIONS_PATH}
26-
ansible-galaxy role install -p ${ANSIBLE_COLLECTIONS_PATH}
25+
ansible-galaxy collection install -r requirements.txt -p ${ANSIBLE_COLLECTIONS_PATH}
26+
ansible-galaxy role install -r requirements.txt -p ${ANSIBLE_COLLECTIONS_PATH}
27+
fi
28+
29+
# Install the necessary openstack.cloud collection explicitly
30+
ansible-galaxy collection install openstack.cloud -f -p ${ANSIBLE_COLLECTIONS_PATH}
31+
32+
# Initialize PYTHONPATH and ANSIBLE_COLLECTIONS_PATHS if not set
33+
export PYTHONPATH=${ANSIBLE_COLLECTIONS_PATH}:${PYTHONPATH:-""}
34+
export ANSIBLE_COLLECTIONS_PATHS=${ANSIBLE_COLLECTIONS_PATH}:${ANSIBLE_COLLECTIONS_PATHS:-""}
35+
36+
# Verify that the collection is installed
37+
if [ ! -d "${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud" ]; then
38+
echo "Error: openstack.cloud collection is not installed correctly."
39+
exit 1
2740
fi
2841

2942
cd "$TEST_DIR"
@@ -41,5 +54,4 @@ fi
4154
echo "Ansible version: $ANSIBLE_VER"
4255
echo "Tests to skip: $SKIP_TESTS"
4356

44-
ansible-test sanity -v \
45-
$SKIP_TESTS
57+
ansible-test sanity -v $SKIP_TESTS

tests/utils/units.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,21 @@ rsync -av . \
2222
"$TEST_DIR" > /dev/null|| true
2323

2424
if [ -f "requirements.txt" ]; then
25-
ansible-galaxy collection install -p ${ANSIBLE_COLLECTIONS_PATH}
26-
ansible-galaxy role install -p ${ANSIBLE_COLLECTIONS_PATH}
25+
ansible-galaxy collection install -r requirements.txt -p ${ANSIBLE_COLLECTIONS_PATH}
26+
ansible-galaxy role install -r requirements.txt -p ${ANSIBLE_COLLECTIONS_PATH}
27+
fi
28+
29+
# Install the necessary openstack.cloud collection explicitly
30+
ansible-galaxy collection install openstack.cloud -f -p ${ANSIBLE_COLLECTIONS_PATH}
31+
32+
# Initialize PYTHONPATH and ANSIBLE_COLLECTIONS_PATHS if not set
33+
export PYTHONPATH=${ANSIBLE_COLLECTIONS_PATH}:${PYTHONPATH:-""}
34+
export ANSIBLE_COLLECTIONS_PATHS=${ANSIBLE_COLLECTIONS_PATH}:${ANSIBLE_COLLECTIONS_PATHS:-""}
35+
36+
# Verify that the collection is installed
37+
if [ ! -d "${ANSIBLE_COLLECTIONS_PATH}/ansible_collections/openstack/cloud" ]; then
38+
echo "Error: openstack.cloud collection is not installed correctly."
39+
exit 1
2740
fi
2841

2942
cd "$TEST_DIR"

0 commit comments

Comments
 (0)