fix collection lookup problem

This fixes the following error:
```
/bin/sh: line 9: cd: /root/.ansible/collections: No such file or directory
```
The fix is to ensure the directory exists before attempting
to `cd` to the directory.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
Rich Megginson 2021-02-09 09:48:10 -07:00 committed by Richard Megginson
parent e109d52e77
commit 209fa56d14

View file

@ -50,6 +50,7 @@
fi
done
for dir in {{ collection_paths | join(" ") }}; do
if [ ! -d "$dir" ]; then continue; fi
cd "$dir"
for subdir in ansible_collections/*/*/plugins/modules; do
if [ -f "$subdir/network_connections.py" ]; then
@ -75,6 +76,7 @@
fi
done
for dir in {{ collection_paths | join(" ") }}; do
if [ ! -d "$dir" ]; then continue; fi
cd "$dir"
for subdir in ansible_collections/*/*/plugins/module_utils; do
if [ -d "$subdir/network_lsr" ]; then