mirskytech/ansible-role-manager

AttributeError: 'NoneType' object has no attribute 'groupdict'

pbuyle opened this issue · 2 comments

When trying to install the ANXS.nodejs role, I get the following error.

$ arm install ANXS.nodejs
fetching `ANXS.nodejs` from Galaxy
Traceback (most recent call last):
  File "/usr/local/bin/arm", line 5, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/arm/main.py", line 48, in main
    args.func(args)
  File "/usr/local/lib/python2.7/dist-packages/arm/commands/install.py", line 42, in run
    roles = self._fetch(argv.role_or_module, argv.no_deps, roles )
  File "/usr/local/lib/python2.7/dist-packages/arm/commands/install.py", line 75, in _fetch
    return retrieve_all_roles(role_ident, alias, roles)
  File "/usr/local/lib/python2.7/dist-packages/arm/util.py", line 37, in retrieve_all_roles
    identifier, alias = split_alias_identifier(role)
  File "/usr/local/lib/python2.7/dist-packages/arm/util.py", line 52, in split_alias_identifier
    return alias_match.groupdict()['identifier'], None
AttributeError: 'NoneType' object has no attribute 'groupdict'

I got a similar error when trying to install it from the GitHub repository

$ arm install git+https://github.com/ANXS/nodejs.git#alias=ANXS.nodejs
fetching `git+https://github.com/ANXS/nodejs.git#alias=ANXS.nodejs` from git
Traceback (most recent call last):
  File "/usr/local/bin/arm", line 5, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/arm/main.py", line 48, in main
    args.func(args)
  File "/usr/local/lib/python2.7/dist-packages/arm/commands/install.py", line 42, in run
    roles = self._fetch(argv.role_or_module, argv.no_deps, roles )
  File "/usr/local/lib/python2.7/dist-packages/arm/commands/install.py", line 75, in _fetch
    return retrieve_all_roles(role_ident, alias, roles)
  File "/usr/local/lib/python2.7/dist-packages/arm/util.py", line 22, in retrieve_all_roles
    role = retrieve_role(identifier)
  File "/usr/local/lib/python2.7/dist-packages/arm/util.py", line 13, in retrieve_role
    return route.fetch(identifier)
  File "/usr/local/lib/python2.7/dist-packages/arm/routes/__init__.py", line 90, in fetch
    _uid = self._uid(identifier)
  File "/usr/local/lib/python2.7/dist-packages/arm/routes/git.py", line 35, in _uid
    pattern_info = pattern_match.groupdict()
AttributeError: 'NoneType' object has no attribute 'groupdict'

And again, a similar error when trying a forked repo.

$ arm install "git+https://github.com/Couto/nodejs.git@anxs#alias=ANXS.nodejs"
fetching `git+https://github.com/Couto/nodejs.git@anxs#alias=ANXS.nodejs` from git
Traceback (most recent call last):
  File "/usr/local/bin/arm", line 5, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/arm/main.py", line 48, in main
    args.func(args)
  File "/usr/local/lib/python2.7/dist-packages/arm/commands/install.py", line 42, in run
    roles = self._fetch(argv.role_or_module, argv.no_deps, roles )
  File "/usr/local/lib/python2.7/dist-packages/arm/commands/install.py", line 75, in _fetch
    return retrieve_all_roles(role_ident, alias, roles)
  File "/usr/local/lib/python2.7/dist-packages/arm/util.py", line 22, in retrieve_all_roles
    role = retrieve_role(identifier)
  File "/usr/local/lib/python2.7/dist-packages/arm/util.py", line 13, in retrieve_role
    return route.fetch(identifier)
  File "/usr/local/lib/python2.7/dist-packages/arm/routes/__init__.py", line 90, in fetch
    _uid = self._uid(identifier)
  File "/usr/local/lib/python2.7/dist-packages/arm/routes/git.py", line 35, in _uid
    pattern_info = pattern_match.groupdict()
AttributeError: 'NoneType' object has no attribute 'groupdict'

I also have the same error when installing another role (https://github.com/Pheromone/ansible-forever) via Git, the role install just fine when using Ansible Galaxy. I noticed the issue with this role when exporting the installed roles to a requirements.txt file via the freeze, and then install roles using this file.

$ arm install --upgrade git+https://github.com/Pheromone/ansible-forever.git
fetching `git+https://github.com/Pheromone/ansible-forever.git` from git
Traceback (most recent call last):
  File "/usr/local/bin/arm", line 5, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/arm/main.py", line 48, in main
    args.func(args)
  File "/usr/local/lib/python2.7/dist-packages/arm/commands/install.py", line 42, in run
    roles = self._fetch(argv.role_or_module, argv.no_deps, roles )
  File "/usr/local/lib/python2.7/dist-packages/arm/commands/install.py", line 75, in _fetch
    return retrieve_all_roles(role_ident, alias, roles)
  File "/usr/local/lib/python2.7/dist-packages/arm/util.py", line 22, in retrieve_all_roles
    role = retrieve_role(identifier)
  File "/usr/local/lib/python2.7/dist-packages/arm/util.py", line 13, in retrieve_role
    return route.fetch(identifier)
  File "/usr/local/lib/python2.7/dist-packages/arm/routes/__init__.py", line 90, in fetch
    _uid = self._uid(identifier)
  File "/usr/local/lib/python2.7/dist-packages/arm/routes/git.py", line 35, in _uid
    pattern_info = pattern_match.groupdict()
AttributeError: 'NoneType' object has no attribute 'groupdict'

This seems to be fixed in master. The author likely needs to make a PyPI release.