ansible / mazer

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

Mazer crashes if server URL has a trailing slash #288

Open rambleraptor opened 5 years ago

rambleraptor commented 5 years ago

Bug Report

MAZER VERSION
name = mazer
version = 1.0.0
config_file = /Users/alexstephen/.ansible/mazer.yml
uname = Darwin, xxx, 18.6.0, Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64, x86_64
executable_location = /Users/alexstephen/.pyenv/versions/2.7.8/bin/mazer
python_version = 2.7.8 (default, Jun 26 2019, 11:22:17) [GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)]
python_executable = /Users/alexstephen/.pyenv/versions/2.7.8/bin/python2.7
CONFIGURATION
SUMMARY

If I run mazer -s with a server URL that has a trailing slash, mazer will fail.

If I run mazer -s with a server URL that does not have a trailing slash, mazer works fine.

STEPS TO REPRODUCE
mazer -s https://galaxy-qa.ansible.com publish releases/googlecloud-test_google_role-0.1.0.tar.gz --api-key "xxx" -vvvv
EXPECTED RESULTS

Mazer works as intended.

ACTUAL RESULTS
argument of type 'NoneType' is not iterable
Traceback (most recent call last):
  File "/Users/alexstephen/.pyenv/versions/2.7.8/bin/mazer", line 10, in <module>
    sys.exit(main())
  File "/Users/alexstephen/.pyenv/versions/2.7.8/lib/python2.7/site-packages/ansible_galaxy_cli/main.py", line 36, in main
    exit_code = cli.run()
  File "/Users/alexstephen/.pyenv/versions/2.7.8/lib/python2.7/site-packages/ansible_galaxy_cli/cli/galaxy.py", line 240, in run
    return self.execute()
  File "/Users/alexstephen/.pyenv/versions/2.7.8/lib/python2.7/site-packages/ansible_galaxy_cli/cli/__init__.py", line 152, in execute
    return fn()
  File "/Users/alexstephen/.pyenv/versions/2.7.8/lib/python2.7/site-packages/ansible_galaxy_cli/cli/galaxy.py", line 323, in execute_publish
    display_callback=self.display)
  File "/Users/alexstephen/.pyenv/versions/2.7.8/lib/python2.7/site-packages/ansible_galaxy/actions/publish.py", line 61, in publish
    display_callback=display_callback)
  File "/Users/alexstephen/.pyenv/versions/2.7.8/lib/python2.7/site-packages/ansible_galaxy/actions/publish.py", line 47, in _publish
    response_data = api.publish_file(form, publish_api_key)
  File "/Users/alexstephen/.pyenv/versions/2.7.8/lib/python2.7/site-packages/ansible_galaxy/rest_api.py", line 55, in wrapped
    server_version = self._get_server_api_version()
  File "/Users/alexstephen/.pyenv/versions/2.7.8/lib/python2.7/site-packages/ansible_galaxy/rest_api.py", line 217, in _get_server_api_version
    if 'current_version' not in data:
TypeError: argument of type 'NoneType' is not iterable