Bug 1154313

Summary: [abrt] ansible: play.py:750:_late_merge_role_tags:TypeError: unhashable type: 'list'
Product: [Fedora] Fedora Reporter: Maciej Lasyk <maciek>
Component: ansibleAssignee: Kevin Fenzi <kevin>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: athmanem, kevin, kupo, maxim
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/baf3e093e8db0ebe31354bf19fa1b25a9f192fb4
Whiteboard: abrt_hash:feea78f266387ce9316b4f26a334c6f7e2bab92f
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-19 17:25:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description Maciej Lasyk 2014-10-18 16:50:07 UTC
Description of problem:
Tried to run playbook which contained badly defined tags:
   tags:                                                                                                                                                                                                                         
       - [ 'prepare-env', 'lxc_container' ]

Version-Release number of selected component:
ansible-1.7.2-1.fc20

Additional info:
reporter:       libreport-2.2.3
cmdline:        /usr/bin/python /usr/bin/ansible-playbook home-dc.yml --limit net-warez --tags lxc_container --list-tasks
executable:     /usr/bin/ansible-playbook
kernel:         3.16.4-200.fc20.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
play.py:750:_late_merge_role_tags:TypeError: unhashable type: 'list'

Traceback (most recent call last):
  File "/usr/bin/ansible-playbook", line 309, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/ansible-playbook", line 202, in main
    vault_password=pb.vault_password)
  File "/usr/lib/python2.7/site-packages/ansible/playbook/play.py", line 161, in __init__
    self._late_merge_role_tags()
  File "/usr/lib/python2.7/site-packages/ansible/playbook/play.py", line 750, in _late_merge_role_tags
    self._tasks[idx].tags = sorted(set(self._tasks[idx].tags + role_tags[this_role]))
TypeError: unhashable type: 'list'

Local variables in innermost frame:
task: {'meta': 'flush_handlers'}
val: <ansible.playbook.task.Task object at 0x1657140>
idx: 1
self: <ansible.playbook.play.Play object at 0x1646880>
role_tags: {'prepare-env-78a7eae7-d59f-469c-b7f4-2561805e571e': []}
this_role: 'prepare-env-78a7eae7-d59f-469c-b7f4-2561805e571e'

Comment 1 Maciej Lasyk 2014-10-18 16:50:11 UTC
Created attachment 948119 [details]
File: backtrace

Comment 2 Maciej Lasyk 2014-10-18 16:50:13 UTC
Created attachment 948120 [details]
File: environ

Comment 3 Kevin Fenzi 2014-10-19 16:51:12 UTC
Right, should be: 

tags:                                                                                                                                                                                                                         
       - prepare-env
       - lxc_container

I agree it would be nice if the error message was more clear, but thats more a thing for upstream. 

Could you file an upstream issue with that thought? or is there something else we can do here?

Comment 4 Maciej Lasyk 2014-10-19 17:08:45 UTC
Hi Kev,

Yep, it's only about showing stack - trace instead of displaying the error message. And think you're right that this should be rather filed to the upstream. This bug was reported automatically by my Fedora and I didn't take notice of the big picture here.

So feel free to close this one. Cheers!

Comment 5 Maciej Lasyk 2014-10-19 17:14:54 UTC
Reported https://github.com/ansible/ansible/issues/9380

Comment 6 Kevin Fenzi 2014-10-19 17:25:24 UTC
Thanks!