ansible / mazer

Experimental Ansible Galaxy Content Manager
GNU General Public License v3.0
114 stars 18 forks source link

Mazer logs errors about a missing 'ansible_collections' dir #287

Open bmbouter opened 5 years ago

bmbouter commented 5 years ago

Bug Report

MAZER VERSION
name = mazer
version = 1.0.0
config_file = /home/vagrant/.ansible/mazer.yml
uname = Linux, pulp3-source-fedora29.localhost.example.com, 4.18.16-300.fc29.x86_64, #1 SMP Sat Oct 20 23:24:08 UTC 2018, x86_64
executable_location = /usr/local/lib/pulp/bin/mazer
python_version = 3.7.0 (default, Aug 30 2018, 14:32:33) [GCC 8.2.1 20180801 (Red Hat 8.2.1-2)]
python_executable = /usr/local/lib/pulp/bin/python3
CONFIGURATION
SUMMARY

I hand a Mazer a GalaxyContent definition has collections_path=/some/path/. Prior to calling mazer I create /some/path/ I do not create /some/path/ansible_collections/.

Mazer logs errors indicating it couldn't find /some/path/ansible_collections/ which makes sense because it doesn't exist. I expect it not to log with a hard error though unless there is some specific initialization I'm supposed to do.

EXPECTED RESULTS

I expected mazer to either not log anything, or log at info about not finding that directory.

ACTUAL RESULTS

I get errors in the logs like:

Jun 20 13:13:16 p3.f rq[8719]: pulp: ansible_galaxy.installed_namespaces_db:ERROR: [Errno 2] No such file or directory: '/tmp/tmpecfibmx5/ansible_collections'
Jun 20 13:13:16 p3.f rq[8719]: Traceback (most recent call last):
Jun 20 13:13:16 p3.f rq[8719]:   File "/usr/local/lib/pulp/lib64/python3.6/site-packages/ansible_galaxy/installed_namespaces_db.py", line 24, in get_namespace_paths
Jun 20 13:13:16 p3.f rq[8719]:     namespace_paths = os.listdir(ansible_collections_path)
Jun 20 13:13:16 p3.f rq[8719]: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpecfibmx5/ansible_collections'
Jun 20 13:13:16 p3.f rq[8719]: pulp: ansible_galaxy.installed_namespaces_db:WARNING: The collections path /tmp/tmpecfibmx5/ansible_collections did not exist so no content or repositories were found.