ansible/ansible — pull request #348 by sfromm (2012-05-09 23:35:19+00:00)
Title: Misc fixes when using -O override_hosts

I bumped into a couple bugs when using -O override_hosts with ansible-playbook today. Commit
086fc64a fixes the error:

ansible-playbook -O test -i ~/ansible_hosts testme.yml
Traceback (most recent call last):
File "/home/stephenf/Source/ansible/bin/ansible-playbook", line 109, in
sys.exit(main(sys.argv[1:]))
File "/home/stephenf/Source/ansible/bin/ansible-playbook", line 86, in main
extra_vars=extra_vars
File "/home/stephenf/Source/ansible/lib/ansible/playbook.py", line 113, in __init__
if not self.inventory._is_script:
AttributeError: 'PlayBook' object has no attribute 'inventory'

Once the above is fixed, another bug showed up in inventory.py where self.groups was set to a dict instead of a list. Commit 18943149	takes just the values of the dict returned by _groups_from_override_hosts().