ansible / galaxy

Legacy Galaxy still available as read-only on https://old-galaxy.ansible.com - looking for the new galaxy -> https://github.com/ansible/galaxy_ng
Apache License 2.0
854 stars 329 forks source link

'ansible-galaxy search foo' tracebacks against 3.0 server #453

Open alikins opened 6 years ago

alikins commented 6 years ago

running 'ansible-galaxy search' against 337a0a446e97ba6f7c9dd5bc02ec9b03310e9653 (release/3.0 branch) fails.

ansible-galaxy -vvv -s http://localhost:8000 search foo

tracebacks:

(galaxy-py27) [newswoop:F27:galaxy (test_ansible-galaxy %)]$ ansible-galaxy -vvv -s http://localhost:8000 search foo
ansible-galaxy 2.5.0 (stable-2.5 5f98ee878e) last updated 2018/04/12 15:43:48 (GMT -400)
  config file = None
  configured module search path = [u'/home/adrian/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/adrian/src/ansible/lib/ansible
  executable location = /home/adrian/src/ansible/bin/ansible-galaxy
  python version = 2.7.14 (default, Mar 14 2018, 13:36:31) [GCC 7.3.1 20180303 (Red Hat 7.3.1-5)]
No config file found; using defaults
Opened /home/adrian/.ansible_galaxy
http://localhost:8000/api/v1/search/roles/?&autocomplete=foo&page_size=1000
ERROR! Unexpected Exception, this is probably a bug: 'username'
the full traceback was:

Traceback (most recent call last):
  File "/home/adrian/src/ansible/bin/ansible-galaxy", line 118, in <module>
    exit_code = cli.run()
  File "/home/adrian/src/ansible/lib/ansible/cli/galaxy.py", line 150, in run
    self.execute()
  File "/home/adrian/src/ansible/lib/ansible/cli/__init__.py", line 155, in execute
    fn()
  File "/home/adrian/src/ansible/lib/ansible/cli/galaxy.py", line 528, in execute_search
    max_len.append(len(role['username'] + '.' + role['name']))
KeyError: 'username'
alikins commented 6 years ago

In this case, there is no 'foo' content to match, but it fails if there is a valid match as well.